28 cl::desc(
"Enable the machine combiner pass"),
40 return make_unique<X86_64MachoTargetObjectFile>();
41 return make_unique<TargetLoweringObjectFileMachO>();
45 return make_unique<X86LinuxNaClTargetObjectFile>();
47 return make_unique<X86ELFTargetObjectFile>();
49 return make_unique<X86WindowsTargetObjectFile>();
51 return make_unique<TargetLoweringObjectFileCOFF>();
57 std::string
Ret =
"e";
82 Ret +=
"-n8:16:32:64";
105 Subtarget(TT, CPU, FS, *this, Options.StackAlignmentOverride) {
118 this->Options.Reciprocals.setDefaults(
"sqrtf",
true, 1);
151 FS += FS.
empty() ?
"+soft-float" :
",+soft-float";
153 auto &
I = SubtargetMap[CPU +
FS];
170 cl::desc(
"Minimize AVX to SSE transition penalty"),
195 return getTM<X86TargetMachine>();
198 void addIRPasses()
override;
199 bool addInstSelector()
override;
200 bool addILPOpts()
override;
201 bool addPreISel()
override;
202 void addPreRegAlloc()
override;
203 void addPostRegAlloc()
override;
204 void addPreEmitPass()
override;
205 void addPreSched2()
override;
210 return new X86PassConfig(
this, PM);
213 void X86PassConfig::addIRPasses() {
219 bool X86PassConfig::addInstSelector() {
224 if (
TM->getTargetTriple().isOSBinFormatELF() &&
233 bool X86PassConfig::addILPOpts() {
240 bool X86PassConfig::addPreISel() {
242 const Triple &TT =
TM->getTargetTriple();
248 void X86PassConfig::addPreRegAlloc() {
252 void X86PassConfig::addPostRegAlloc() {
258 void X86PassConfig::addPreEmitPass() {
char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
void LLVMInitializeX86Target()
static cl::opt< bool > EnableMachineCombinerPass("x86-machine-combiner", cl::desc("Enable the machine combiner pass"), cl::init(true), cl::Hidden)
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
static std::string computeDataLayout(const Triple &TT)
TargetIRAnalysis getTargetIRAnalysis() override
Get a TargetIRAnalysis implementation for the target.
char & EarlyIfConverterID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions...
Analysis pass providing the TargetTransformInfo.
std::string str() const
str - Get the contents as an std::string.
FunctionPass * createX86CallFrameOptimization()
createX86CallFrameOptimization - Return a pass that optimizes the code-size of x86 call sequences...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
FunctionPass * createX86IssueVZeroUpperPass()
createX86IssueVZeroUpperPass - This pass inserts AVX vzeroupper instructions before each call to avoi...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
static const char * getManglingComponent(const Triple &T)
bool isOSWindows() const
Tests whether the OS is Windows.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
FunctionPass * createX86PadShortFunctions()
createX86PadShortFunctions - Return a pass that pads short functions with NOOPs.
FunctionPass * createAtomicExpandPass(const TargetMachine *TM)
No attributes have been set.
Target-Independent Code Generator Pass Configuration Options.
bool isArch64Bit() const
Test whether the architecture is 64-bit.
bool isOSLinux() const
Tests whether the OS is Linux.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
FunctionPass * createX86FixupLEAs()
createX86FixupLEAs - Return a a pass that selectively replaces certain instructions (like add...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
initializer< Ty > init(const Ty &Val)
FunctionPass * createX86ExpandPseudoPass()
Return a Machine IR pass that expands X86-specific pseudo instructions into a sequence of actual inst...
FunctionPass * createX86GlobalBaseRegPass()
createX86GlobalBaseRegPass - This pass initializes a global base register for PIC on x86-32...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
TargetRecip Reciprocals
This class encapsulates options for reciprocal-estimate code generation.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
~X86TargetMachine() override
Triple - Helper class for working with autoconf configuration names.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
X86TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
X86TargetMachine ctor - Create an X86 target.
FunctionPass * createExecutionDependencyFixPass(const TargetRegisterClass *RC)
createExecutionDependencyFixPass - This pass fixes execution time problems with dependent instruction...
unsigned StackAlignmentOverride
StackAlignmentOverride - Override default stack alignment for target.
FunctionPass * createX86FloatingPointStackifierPass()
createX86FloatingPointStackifierPass - This function returns a pass which converts floating point reg...
Target - Wrapper for Target specific information.
static cl::opt< bool > UseVZeroUpper("x86-use-vzeroupper", cl::Hidden, cl::desc("Minimize AVX to SSE transition penalty"), cl::init(true))
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
FunctionPass * createX86ISelDag(X86TargetMachine &TM, CodeGenOpt::Level OptLevel)
createX86ISelDag - This pass converts a legalized DAG into a X86-specific DAG, ready for instruction ...
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
const X86Subtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
StringRef getValueAsString() const
Return the attribute's value as a string.
bool isTargetWin64() const
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
bool isKnownWindowsMSVCEnvironment() const
StringRef - Represent a constant reference to a string, i.e.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
FunctionPass * createX86WinEHStatePass()
createX86WinEHStatePass - Return an IR pass that inserts EH registration stack objects and explicit E...
FunctionPass * createCleanupLocalDynamicTLSPass()
createCleanupLocalDynamicTLSPass() - This pass combines multiple accesses to local-dynamic TLS variab...
void setDefaults(const StringRef &Key, bool Enable, unsigned RefSteps)
Set whether a particular reciprocal operation is enabled and how many refinement steps are needed whe...
bool empty() const
empty - Check if the string is empty.