Go to the documentation of this file.
44 #define DEBUG_TYPE "subtarget"
46 #define GET_SUBTARGETINFO_TARGET_DESC
47 #define GET_SUBTARGETINFO_CTOR
48 #include "X86GenSubtargetInfo.inc"
54 cl::desc(
"Enable early if-conversion on X86"));
102 if (isa_and_nonnull<Function>(GV))
144 if (CR->getUnsignedMax().ult(128))
175 if (AllowTaggedGlobals && GV && !isa<Function>(GV))
216 const Function *
F = dyn_cast_or_null<Function>(GV);
225 if (((
F &&
F->hasFnAttribute(Attribute::NonLazyBind)) ||
226 (!
F &&
M.getRtLibUseGOT())) &&
236 if (
F &&
F->hasFnAttribute(Attribute::NonLazyBind))
266 assert(!FullFS.empty() &&
"Failed to parse X86 triple");
269 FullFS = (
Twine(FullFS) +
"," +
FS).str();
279 IsUnalignedMem16Slow =
false;
281 LLVM_DEBUG(
dbgs() <<
"Subtarget features: SSELevel " << X86SSELevel
282 <<
", 3DNowLevel " << X863DNowLevel <<
", 64bit "
283 << HasX86_64 <<
"\n");
284 if (Is64Bit && !HasX86_64)
291 if (StackAlignOverride)
292 stackAlignment = *StackAlignOverride;
295 stackAlignment =
Align(16);
298 if (PreferVectorWidthOverride)
299 PreferVectorWidth = PreferVectorWidthOverride;
300 else if (Prefer128Bit)
301 PreferVectorWidth = 128;
302 else if (Prefer256Bit)
303 PreferVectorWidth = 256;
309 initSubtargetFeatures(CPU, TuneCPU,
FS);
316 unsigned PreferVectorWidthOverride,
317 unsigned RequiredVectorWidth)
320 StackAlignOverride(StackAlignOverride),
321 PreferVectorWidthOverride(PreferVectorWidthOverride),
322 RequiredVectorWidth(RequiredVectorWidth),
323 InstrInfo(initializeSubtargetDependencies(CPU, TuneCPU,
FS)),
324 TLInfo(
TM, *
this), FrameLowering(*
this, getStackAlignment()) {
341 RegBankInfo.reset(RBI);
346 return CallLoweringInfo.get();
350 return InstSelector.get();
358 return RegBankInfo.get();
366 std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
const {
@ MO_DARWIN_NONLAZY
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
This class provides the information for the target register banks.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
bool hasCommonLinkage() const
bool isTargetLinux() const
static bool is64Bit(const char *name)
InstructionSelector * createX86InstructionSelector(const X86TargetMachine &TM, X86Subtarget &, X86RegisterBankInfo &)
Triple - Helper class for working with autoconf configuration names.
bool isLegalToCallImmediateAddr() const
Return true if the subtarget allows calls to immediate address.
bool isTargetNaCl() const
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
@ MO_GOTOFF
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
X86Subtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const X86TargetMachine &TM, MaybeAlign StackAlignOverride, unsigned PreferVectorWidthOverride, unsigned RequiredVectorWidth)
This constructor initializes the data members to match that of the specified triple.
@ MO_GOT
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
std::unique_ptr< ScheduleDAGMutation > createX86MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createX86MacroFusionDAGMutation()); to X86PassConfig::crea...
@ MO_COFFSTUB
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
bool isTargetKFreeBSD() const
@ MO_PLT
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
bool isTargetWin32() const
const X86RegisterInfo * getRegisterInfo() const override
@ MO_GOTPCREL
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
void getPostRAMutations(std::vector< std::unique_ptr< ScheduleDAGMutation >> &Mutations) const override
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
@ MO_GOTPCREL_NORELAX
MO_GOTPCREL_NORELAX - Same as MO_GOTPCREL except that R_X86_64_GOTPCREL relocations are guaranteed to...
unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const
const LegalizerInfo * getLegalizerInfo() const override
unsigned char classifyLocalReference(const GlobalValue *GV) const
Classify a global variable reference for the current subtarget according to how we should reference i...
bool isPositionIndependent() const
const RegisterBankInfo * getRegBankInfo() const override
bool enableEarlyIfConversion() const override
Holds all the information related to register banks.
Provides the logic to select generic machine instructions.
@ MO_DARWIN_NONLAZY_PIC_BASE
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
InstructionSelector * getInstructionSelector() const override
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Module * getParent()
Get the module that this global value is contained inside of...
@ MO_PIC_BASE_OFFSET
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
bool isTargetCOFF() const
static cl::opt< bool > X86EarlyIfConv("x86-early-ifcvt", cl::Hidden, cl::desc("Enable early if-conversion on X86"))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const X86TargetLowering * getTargetLowering() const override
A Module instance is used to store all the information related to an LLVM module.
unsigned char classifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
bool isTargetDarwin() const
@ MO_DLLIMPORT
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...
StringRef - Represent a constant reference to a string, i.e.
Analysis the ScalarEvolution expression for r is this
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setPICStyle(PICStyles::Style Style)
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
This class provides the information for the target register banks.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const
Classify a global function reference for the current subtarget.
Optional< ConstantRange > getAbsoluteSymbolRange() const
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None.
bool isDeclarationForLinker() const
bool hasDLLImportStorageClass() const
const char LLVMTargetMachineRef TM
CodeModel::Model getCodeModel() const
Returns the code model.
@ MO_ABS8
MO_ABS8 - On a symbol operand this indicates that the symbol is known to be an absolute symbol in ran...
const CallLowering * getCallLowering() const override
Methods used by Global ISel.
bool isPositionIndependent() const
@ X86_RegCall
Register calling convention used for parameters transfer optimization.
std::string ParseX86Triple(const Triple &TT)