43 #define DEBUG_TYPE "subtarget" 45 #define GET_SUBTARGETINFO_TARGET_DESC 46 #define GET_SUBTARGETINFO_CTOR 47 #include "X86GenSubtargetInfo.inc" 53 cl::desc(
"Enable early if-conversion on X86"));
92 if (isa<Function>(GV))
134 if (CR->getUnsignedMax().ult(128))
191 const Function *
F = dyn_cast_or_null<Function>(GV);
230 std::string CPUName = CPU;
234 std::string FullFS =
FS;
239 FullFS =
"+sse2," + FullFS;
244 if (CPUName ==
"generic") {
246 FullFS =
"+64bit," + FullFS;
255 FullFS =
"+sahf," + FullFS;
273 ToggleFeature(X86::Mode64Bit);
274 else if (In32BitMode)
275 ToggleFeature(X86::Mode32Bit);
276 else if (In16BitMode)
277 ToggleFeature(X86::Mode16Bit);
290 if (StackAlignOverride)
308 if (PreferVectorWidthOverride)
309 PreferVectorWidth = PreferVectorWidthOverride;
311 PreferVectorWidth = 128;
313 PreferVectorWidth = 256;
318 initSubtargetFeatures(CPU, FS);
325 unsigned PreferVectorWidthOverride,
326 unsigned RequiredVectorWidth)
328 TM(TM),
TargetTriple(TT), StackAlignOverride(StackAlignOverride),
329 PreferVectorWidthOverride(PreferVectorWidthOverride),
330 RequiredVectorWidth(RequiredVectorWidth),
336 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
379 std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
const {
bool isDeclarationForLinker() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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.
Align stackAlignment
The minimum alignment known to hold of the stack frame on entry to the function and which must be mai...
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 hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool hasDLLImportStorageClass() const
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
bool Prefer128Bit
Indicates target prefers 128 bit instructions.
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...
bool isTargetSolaris() const
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...
bool hasCommonLinkage() const
bool Prefer256Bit
Indicates target prefers 256 bit instructions.
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
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.
Align getStackAlignment() const
Returns the minimum alignment known to hold of the stack frame on entry to the function and which mus...
X863DNowEnum X863DNowLevel
MMX, 3DNow, 3DNow Athlon, or none supported.
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
PICStyles::Style PICStyle
Which PIC style to use.
bool isPositionIndependent() const
bool enableEarlyIfConversion() const override
bool isTargetDarwin() const
bool IsUAMem16Slow
True if unaligned memory accesses of 16-bytes are slow.
#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
std::unique_ptr< InstructionSelector > InstSelector
Register calling convention used for parameters transfer optimization.
bool HasX86_64
True if the processor supports X86-64 instructions.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
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.
std::unique_ptr< RegisterBankInfo > RegBankInfo
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
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.
X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS, const X86TargetMachine &TM, MaybeAlign StackAlignOverride, unsigned PreferVectorWidthOverride, unsigned RequiredVectorWidth)
This constructor initializes the data members to match that of the specified triple.
InstructionSelector * getInstructionSelector() const override
X86SSEEnum X86SSELevel
SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
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...
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.
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
bool hasFastGather() const
Triple TargetTriple
What processor and OS we're targeting.
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...