42 #define DEBUG_TYPE "subtarget" 44 #define GET_SUBTARGETINFO_TARGET_DESC 45 #define GET_SUBTARGETINFO_CTOR 46 #include "X86GenSubtargetInfo.inc" 52 cl::desc(
"Enable early if-conversion on X86"));
93 if (isa_and_nonnull<Function>(GV))
135 if (CR->getUnsignedMax().ult(128))
196 const Function *
F = dyn_cast_or_null<Function>(GV);
205 if (((
F &&
F->hasFnAttribute(Attribute::NonLazyBind)) ||
206 (!
F && M.getRtLibUseGOT())) &&
216 if (
F &&
F->hasFnAttribute(Attribute::NonLazyBind))
246 assert(!FullFS.empty() &&
"Failed to parse X86 triple");
249 FullFS = (
Twine(FullFS) +
"," +
FS).str();
259 IsUAMem16Slow =
false;
261 LLVM_DEBUG(
dbgs() <<
"Subtarget features: SSELevel " << X86SSELevel
262 <<
", 3DNowLevel " << X863DNowLevel <<
", 64bit " 263 << HasX86_64 <<
"\n");
264 if (In64BitMode && !HasX86_64)
271 if (StackAlignOverride)
272 stackAlignment = *StackAlignOverride;
275 stackAlignment =
Align(16);
278 if (PreferVectorWidthOverride)
279 PreferVectorWidth = PreferVectorWidthOverride;
280 else if (Prefer128Bit)
281 PreferVectorWidth = 128;
282 else if (Prefer256Bit)
283 PreferVectorWidth = 256;
289 initSubtargetFeatures(CPU, TuneCPU,
FS);
296 unsigned PreferVectorWidthOverride,
297 unsigned RequiredVectorWidth)
300 StackAlignOverride(StackAlignOverride),
301 PreferVectorWidthOverride(PreferVectorWidthOverride),
302 RequiredVectorWidth(RequiredVectorWidth),
303 InstrInfo(initializeSubtargetDependencies(CPU, TuneCPU,
FS)),
304 TLInfo(
TM, *this), FrameLowering(*this, getStackAlignment()) {
321 RegBankInfo.reset(RBI);
326 return CallLoweringInfo.get();
330 return InstSelector.get();
338 return RegBankInfo.get();
346 std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
const {
bool isDeclarationForLinker() const
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
const CallLowering * getCallLowering() const override
Methods used by Global ISel.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module.
void setPICStyle(PICStyles::Style Style)
const LegalizerInfo * getLegalizerInfo() const override
std::unique_ptr< ScheduleDAGMutation > createX86MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createX86MacroFusionDAGMutation()); to X86PassConfig::crea...
static cl::opt< bool > X86EarlyIfConv("x86-early-ifcvt", cl::Hidden, cl::desc("Enable early if-conversion on X86"))
Optional< ConstantRange > getAbsoluteSymbolRange() const
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None.
bool hasDLLImportStorageClass() const
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
std::string ParseX86Triple(const Triple &TT)
unsigned char classifyLocalReference(const GlobalValue *GV) const
Classify a global variable reference for the current subtarget according to how we should reference i...
Holds all the information related to register banks.
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class provides the information for the target register banks.
This file contains the simple types necessary to represent the attributes associated with functions a...
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
bool hasCommonLinkage() const
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
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_ABS8 - On a symbol operand this indicates that the symbol is known to be an absolute symbol in ran...
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
const X86TargetLowering * getTargetLowering() const override
bool isTargetKFreeBSD() const
bool isLegalToCallImmediateAddr() const
Return true if the subtarget allows calls to immediate address.
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
bool enableEarlyIfConversion() const override
bool isTargetDarwin() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
This file declares the targeting of the RegisterBankInfo class for X86.
const X86RegisterInfo * getRegisterInfo() const override
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
bool isTargetWin32() const
InstructionSelector * createX86InstructionSelector(const X86TargetMachine &TM, X86Subtarget &, X86RegisterBankInfo &)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void getPostRAMutations(std::vector< std::unique_ptr< ScheduleDAGMutation >> &Mutations) const override
CodeModel::Model getCodeModel() const
Returns the code model.
This file describes how to lower LLVM calls to machine code calls.
Register calling convention used for parameters transfer optimization.
Provides the logic to select generic machine instructions.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
This class provides the information for the target register banks.
bool isPositionIndependent() const
InstructionSelector * getInstructionSelector() const override
bool isTargetCOFF() const
unsigned char classifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
bool isTargetLinux() const
This file describes how to lower LLVM calls to machine code calls.
This file declares the targeting of the Machinelegalizer class for X86.
bool isPositionIndependent() const
const RegisterBankInfo * getRegBankInfo() const override
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const
Classify a global function reference for the current subtarget.
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
StringRef - Represent a constant reference to a string, i.e.
unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...