54 cl::desc(
"Enable the machine combiner pass"),
82 return llvm::make_unique<X86_64MachoTargetObjectFile>();
83 return llvm::make_unique<TargetLoweringObjectFileMachO>();
87 return llvm::make_unique<X86FreeBSDTargetObjectFile>();
89 return llvm::make_unique<X86LinuxNaClTargetObjectFile>();
91 return llvm::make_unique<X86SolarisTargetObjectFile>();
93 return llvm::make_unique<X86FuchsiaTargetObjectFile>();
95 return llvm::make_unique<X86ELFTargetObjectFile>();
97 return llvm::make_unique<X86WindowsTargetObjectFile>();
99 return llvm::make_unique<TargetLoweringObjectFileCOFF>();
105 std::string
Ret =
"e";
118 Ret +=
"-i64:32-f64:32";
135 Ret +=
"-n8:16:32:64";
141 Ret +=
"-a:0:32-S32";
238 Key += FS.
empty() ?
"+soft-float" :
",+soft-float";
242 auto &
I = SubtargetMap[Key];
248 I = llvm::make_unique<X86Subtarget>(
TargetTriple, CPU, FS, *
this,
259 cl::desc(
"Minimize AVX to SSE transition penalty"),
285 return getTM<X86TargetMachine>();
295 void addIRPasses()
override;
296 bool addInstSelector()
override;
297 #ifdef LLVM_BUILD_GLOBAL_ISEL
298 bool addIRTranslator()
override;
299 bool addLegalizeMachineIR()
override;
300 bool addRegBankSelect()
override;
301 bool addGlobalInstructionSelect()
override;
303 bool addILPOpts()
override;
304 bool addPreISel()
override;
305 void addPreRegAlloc()
override;
306 void addPostRegAlloc()
override;
307 void addPreEmitPass()
override;
308 void addPreSched2()
override;
316 return "X86 Execution Dependency Fix";
324 "X86 Execution Dependency Fix",
false,
false)
327 return new X86PassConfig(*
this, PM);
330 void X86PassConfig::addIRPasses() {
339 bool X86PassConfig::addInstSelector() {
344 if (
TM->getTargetTriple().isOSBinFormatELF() &&
352 #ifdef LLVM_BUILD_GLOBAL_ISEL
353 bool X86PassConfig::addIRTranslator() {
358 bool X86PassConfig::addLegalizeMachineIR() {
363 bool X86PassConfig::addRegBankSelect() {
368 bool X86PassConfig::addGlobalInstructionSelect() {
374 bool X86PassConfig::addILPOpts() {
382 bool X86PassConfig::addPreISel() {
384 const Triple &TT =
TM->getTargetTriple();
390 void X86PassConfig::addPreRegAlloc() {
401 void X86PassConfig::addPostRegAlloc() {
407 void X86PassConfig::addPreEmitPass() {
409 addPass(
new X86ExecutionDepsFix());
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)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
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.
FunctionPass * createX86OptimizeLEAs()
Return a pass that removes redundant LEA instructions and redundant address recalculations.
FunctionPass * createX86FixupBWInsts()
Return a Machine IR pass that selectively replaces certain byte and word instructions by equivalent 3...
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
void initializeFixupBWInstPassPass(PassRegistry &)
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
FunctionPass * createX86FixupSetCC()
Return a pass that transforms setcc + movzx pairs into xor + setcc.
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::unique_ptr< ScheduleDAGMutation > createX86MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createX86MacroFusionDAGMutation()); to X86PassConfig::crea...
FunctionPass * 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()
This pass inserts AVX vzeroupper instructions before each call to avoid transition penalty between fu...
FunctionPass * createX86EvexToVexInsts()
This pass replaces EVEX ecnoded of AVX-512 instructiosn by VEX encoding when possible in order to red...
StringRef substr(size_t Start, size_t N=StringRef::npos) const
Return a reference to the substring from [Start, Start + N).
void reserve(size_type N)
X86TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Create an X86 target.
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.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
FunctionPass * createX86PadShortFunctions()
Return a pass that pads short functions with NOOPs.
FunctionPass * createX86CmovConverterPass()
This pass converts X86 cmov instructions into branch when profitable.
This file contains the simple types necessary to represent the attributes associated with functions a...
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)
void initializeEvexToVexInstPassPass(PassRegistry &)
FunctionPass * createX86FixupLEAs()
Return a pass that selectively replaces certain instructions (like add, sub, inc, dec...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
ScheduleDAGMILive * createGenericSchedLive(MachineSchedContext *C)
Create the standard converging machine scheduler.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
char & LiveRangeShrinkID
LiveRangeShrink pass.
initializer< Ty > init(const Ty &Val)
void initializeX86ExecutionDepsFixPass(PassRegistry &)
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
FunctionPass * createX86ExpandPseudoPass()
Return a Machine IR pass that expands X86-specific pseudo instructions into a sequence of actual inst...
FunctionPass * createX86GlobalBaseRegPass()
This pass initializes a global base register for PIC on x86-32.
static bool is64Bit(const char *name)
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
const X86Subtarget * getSubtargetImpl() const =delete
void initializeFixupLEAPassPass(PassRegistry &)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
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.
bool isWindowsCoreCLREnvironment() const
~X86TargetMachine() override
Windows x64, Windows Itanium (IA-64)
Triple - Helper class for working with autoconf configuration names.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
unsigned StackAlignmentOverride
StackAlignmentOverride - Override default stack alignment for target.
This pass is responsible for selecting generic machine instructions to target-specific instructions...
FunctionPass * createX86FloatingPointStackifierPass()
This function returns a pass which converts floating-point register references and pseudo instruction...
Target - Wrapper for Target specific information.
This file describes how to lower LLVM calls to machine code calls.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static cl::opt< bool > UseVZeroUpper("x86-use-vzeroupper", cl::Hidden, cl::desc("Minimize AVX to SSE transition penalty"), cl::init(true))
llvm_unreachable("Unknown RegBank!")
FunctionPass * createX86WinAllocaExpander()
Return a pass that expands WinAlloca pseudo-instructions.
A ScheduleDAG for scheduling lists of MachineInstr.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
INITIALIZE_PASS(X86ExecutionDepsFix,"x86-execution-deps-fix","X86 Execution Dependency Fix", false, false) TargetPassConfig *X86TargetMachine
FunctionPass * createX86ISelDag(X86TargetMachine &TM, CodeGenOpt::Level OptLevel)
This pass converts a legalized DAG into a X86-specific DAG, ready for instruction scheduling...
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Target & getTheX86_32Target()
void initializeWinEHStatePassPass(PassRegistry &)
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
StringRef getValueAsString() const
Return the attribute's value as a string.
This file declares the IRTranslator pass.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
This file describes how to lower LLVM calls to machine code calls.
This file declares the targeting of the Machinelegalizer class for X86.
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
FunctionPass * createX86WinEHStatePass()
Return an IR pass that inserts EH registration stack objects and explicit EH state updates...
bool isPS4() const
Tests whether the target is the PS4 platform.
FunctionPass * createAtomicExpandPass()
Target & getTheX86_64Target()
FunctionPass * createCleanupLocalDynamicTLSPass()
This pass combines multiple accesses to local-dynamic TLS variables so that the TLS base address for ...
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.