47 cl::desc(
"Enable the CCMP formation pass"),
52 cl::desc(
"Enable the conditional branch tuning pass"),
56 cl::desc(
"Enable the machine combiner pass"),
60 cl::desc(
"Suppress STP for AArch64"),
64 "aarch64-enable-simd-scalar",
65 cl::desc(
"Enable use of AdvSIMD scalar integer instructions"),
70 cl::desc(
"Enable the promote constant pass"),
74 "aarch64-enable-collect-loh",
75 cl::desc(
"Enable the pass that emits the linker optimization hints (LOH)"),
80 cl::desc(
"Enable the pass that removes dead"
81 " definitons and replaces stores to"
82 " them with stores to the zero"
87 "aarch64-enable-copyelim",
92 cl::desc(
"Enable the load/store pair"
93 " optimization pass"),
98 cl::desc(
"Run SimplifyCFG after expanding atomic operations"
99 " to make use of cmpxchg flow-based information"),
104 cl::desc(
"Run early if-conversion"),
109 cl::desc(
"Enable the condition optimizer pass"),
114 cl::desc(
"Work around Cortex-A53 erratum 835769"),
119 cl::desc(
"Enable optimizations on complex GEPs"),
124 cl::desc(
"Relax out of range conditional branches"));
129 cl::desc(
"Enable the global merge pass"));
133 cl::desc(
"Enable the loop data prefetch pass"),
137 "aarch64-enable-global-isel-at-O",
cl::Hidden,
138 cl::desc(
"Enable GlobalISel at or below an opt level (-1 to disable)"),
174 return llvm::make_unique<AArch64_MachoTargetObjectFile>();
176 return llvm::make_unique<AArch64_COFFTargetObjectFile>();
178 return llvm::make_unique<AArch64_ELFTargetObjectFile>();
186 return "e-m:e-p:32:32-i8:8-i16:16-i64:64-S128";
188 return "e-m:o-i64:64-i128:128-n32:64-S128";
190 return "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128";
192 return "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
193 return "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
219 TT, CPU, FS, Options,
222 isLittle(LittleEndian) {
246 I = llvm::make_unique<AArch64Subtarget>(
TargetTriple, CPU, FS, *
this,
252 void AArch64leTargetMachine::anchor() { }
260 void AArch64beTargetMachine::anchor() { }
280 return getTM<AArch64TargetMachine>();
308 void addIRPasses()
override;
309 bool addPreISel()
override;
310 bool addInstSelector()
override;
311 #ifdef LLVM_BUILD_GLOBAL_ISEL
312 bool addIRTranslator()
override;
313 bool addLegalizeMachineIR()
override;
314 bool addRegBankSelect()
override;
315 void addPreGlobalInstructionSelect()
override;
316 bool addGlobalInstructionSelect()
override;
318 bool addILPOpts()
override;
319 void addPreRegAlloc()
override;
320 void addPostRegAlloc()
override;
321 void addPreSched2()
override;
322 void addPreEmitPass()
override;
324 bool isGlobalISelEnabled()
const override;
336 return new AArch64PassConfig(*
this, PM);
339 void AArch64PassConfig::addIRPasses() {
382 bool AArch64PassConfig::addPreISel() {
401 bool AArch64PassConfig::addInstSelector() {
413 #ifdef LLVM_BUILD_GLOBAL_ISEL
414 bool AArch64PassConfig::addIRTranslator() {
419 bool AArch64PassConfig::addLegalizeMachineIR() {
424 bool AArch64PassConfig::addRegBankSelect() {
429 void AArch64PassConfig::addPreGlobalInstructionSelect() {
435 bool AArch64PassConfig::addGlobalInstructionSelect() {
441 bool AArch64PassConfig::isGlobalISelEnabled()
const {
445 bool AArch64PassConfig::addILPOpts() {
462 void AArch64PassConfig::addPreRegAlloc() {
476 void AArch64PassConfig::addPostRegAlloc() {
486 void AArch64PassConfig::addPreSched2() {
498 void AArch64PassConfig::addPreEmitPass() {
char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
Target & getTheAArch64beTarget()
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
void initializeAArch64A53Fix835769Pass(PassRegistry &)
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
FunctionPass * createFalkorMarkStridedAccessesPass()
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
void initializeAArch64LoadStoreOptPass(PassRegistry &)
Target & getTheAArch64leTarget()
This pass implements the localization mechanism described at the top of this file.
char & EarlyIfConverterID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions...
Analysis pass providing the TargetTransformInfo.
ScheduleDAGMI * createGenericSchedPostRA(MachineSchedContext *C)
Create a generic scheduler with no vreg liveness or DAG mutation passes.
Pass * createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset, bool OnlyOptimizeForSize=false, bool MergeExternalByDefault=false)
GlobalMerge - This pass merges internal (by default) globals into structs to enable reuse of a base p...
char & BranchRelaxationPassID
BranchRelaxation - This pass replaces branches that need to jump further than is supported by a branc...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
FunctionPass * createAArch64ConditionalCompares()
void initializeAArch64RedundantCopyEliminationPass(PassRegistry &)
AArch64TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool IsLittleEndian)
Create an AArch64 architecture model.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
ModulePass * createAArch64PromoteConstantPass()
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
FunctionPass * createLoopDataPrefetchPass()
const Triple & getTargetTriple() const
FunctionPass * createAArch64CollectLOHPass()
static cl::opt< bool > EnableEarlyIfConversion("aarch64-enable-early-ifcvt", cl::Hidden, cl::desc("Run early if-conversion"), cl::init(true))
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
FunctionPass * createAArch64VectorByElementOptPass()
createAArch64VectorByElementOptPass - returns an instance of the vector by element optimization pass...
static cl::opt< bool > EnableMCR("aarch64-enable-mcr", cl::desc("Enable the machine combiner pass"), cl::init(true), cl::Hidden)
static cl::opt< bool > EnableLoopDataPrefetch("aarch64-enable-loop-data-prefetch", cl::Hidden, cl::desc("Enable the loop data prefetch pass"), cl::init(true))
static cl::opt< int > EnableGlobalISelAtO("aarch64-enable-global-isel-at-O", cl::Hidden, cl::desc("Enable GlobalISel at or below an opt level (-1 to disable)"), cl::init(-1))
void initializeLDTLSCleanupPass(PassRegistry &)
static cl::opt< bool > EnablePromoteConstant("aarch64-enable-promote-const", cl::desc("Enable the promote constant pass"), cl::init(true), cl::Hidden)
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
Target & getTheARM64Target()
void initializeAArch64CollectLOHPass(PassRegistry &)
Target-Independent Code Generator Pass Configuration Options.
zlib-gnu style compression
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
FunctionPass * createAArch64A57FPLoadBalancing()
static cl::opt< bool > EnableCondBrTuning("aarch64-enable-cond-br-tune", cl::desc("Enable the conditional branch tuning pass"), cl::init(true), cl::Hidden)
static cl::opt< cl::boolOrDefault > EnableGlobalMerge("aarch64-enable-global-merge", cl::Hidden, cl::desc("Enable the global merge pass"))
FunctionPass * createAArch64CleanupLocalDynamicTLSPass()
static cl::opt< bool > EnableCollectLOH("aarch64-enable-collect-loh", cl::desc("Enable the pass that emits the linker optimization hints (LOH)"), cl::init(true), cl::Hidden)
static cl::opt< bool > EnableDeadRegisterElimination("aarch64-enable-dead-defs", cl::Hidden, cl::desc("Enable the pass that removes dead"" definitons and replaces stores to"" them with stores to the zero"" register"), cl::init(true))
AArch64beTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
ScheduleDAGMILive * createGenericSchedLive(MachineSchedContext *C)
Create the standard converging machine scheduler.
static cl::opt< bool > EnableAdvSIMDScalar("aarch64-enable-simd-scalar", cl::desc("Enable use of AdvSIMD scalar integer instructions"), cl::init(false), cl::Hidden)
FunctionPass * createAArch64LoadStoreOptimizationPass()
createAArch64LoadStoreOptimizationPass - returns an instance of the load / store optimization pass...
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
void initializeAArch64A57FPLoadBalancingPass(PassRegistry &)
Function Alias Analysis false
initializer< Ty > init(const Ty &Val)
void initializeAArch64PromoteConstantPass(PassRegistry &)
FunctionPass * createSeparateConstOffsetFromGEPPass(const TargetMachine *TM=nullptr, bool LowerGEP=false)
void initializeAArch64ExpandPseudoPass(PassRegistry &)
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
AArch64leTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
void LLVMInitializeAArch64Target()
void initializeAArch64VectorByElementOptPass(PassRegistry &)
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
FunctionPass * createAArch64AdvSIMDScalar()
const AArch64Subtarget * getSubtargetImpl() const =delete
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...
std::unique_ptr< ScheduleDAGMutation > createAArch64MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAArch64MacroFusionDAGMutation()); to AArch64PassConf...
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
std::unique_ptr< ScheduleDAGMutation > createStoreClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
FunctionPass * createAArch64RedundantCopyEliminationPass()
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
~AArch64TargetMachine() override
Triple - Helper class for working with autoconf configuration names.
static cl::opt< bool > EnableRedundantCopyElimination("aarch64-enable-copyelim", cl::desc("Enable the redundant copy elimination pass"), cl::init(true), cl::Hidden)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
void initializeFalkorMarkStridedAccessesLegacyPass(PassRegistry &)
char & PostRASchedulerID
createPostRAScheduler - This pass performs post register allocation scheduling.
static cl::opt< bool > EnableA53Fix835769("aarch64-fix-cortex-a53-835769", cl::Hidden, cl::desc("Work around Cortex-A53 erratum 835769"), cl::init(false))
std::unique_ptr< ScheduleDAGMutation > createLoadClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
static cl::opt< bool > EnableGEPOpt("aarch64-enable-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(false))
FunctionPass * createAArch64ExpandPseudoPass()
Returns an instance of the pseudo instruction expansion pass.
static cl::opt< bool > EnableCondOpt("aarch64-enable-condopt", cl::desc("Enable the condition optimizer pass"), cl::init(true), cl::Hidden)
void initializeFalkorHWPFFixPass(PassRegistry &)
FunctionPass * createAArch64A53Fix835769()
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
This pass is responsible for selecting generic machine instructions to target-specific instructions...
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
Target - Wrapper for Target specific information.
char & PeepholeOptimizerID
PeepholeOptimizer - This pass performs peephole optimizations - like extension and comparison elimina...
static cl::opt< bool > EnableFalkorHWPFFix("aarch64-enable-falkor-hwpf-fix", cl::init(true), cl::Hidden)
FunctionPass * createAArch64ConditionOptimizerPass()
TargetIRAnalysis getTargetIRAnalysis() override
Get the TargetIRAnalysis for this target.
FunctionPass * createAArch64ISelDag(AArch64TargetMachine &TM, CodeGenOpt::Level OptLevel)
createAArch64ISelDag - This pass converts a legalized DAG into a AArch64-specific DAG...
A ScheduleDAG for scheduling lists of MachineInstr.
static std::string computeDataLayout(const Triple &TT, const MCTargetOptions &Options, bool LittleEndian)
static cl::opt< bool > EnableAtomicTidy("aarch64-enable-atomic-cfg-tidy", cl::Hidden, cl::desc("Run SimplifyCFG after expanding atomic operations"" to make use of cmpxchg flow-based information"), cl::init(true))
void initializeAArch64ConditionOptimizerPass(PassRegistry &)
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
StringMap< std::unique_ptr< AArch64Subtarget > > SubtargetMap
FunctionPass * createAArch64StorePairSuppressPass()
FunctionPass * createAArch64CondBrTuning()
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.
FunctionPass * createFalkorHWPFFixPass()
static cl::opt< bool > EnableCCMP("aarch64-enable-ccmp", cl::desc("Enable the CCMP formation pass"), cl::init(true), cl::Hidden)
void initializeAArch64ConditionalComparesPass(PassRegistry &)
static cl::opt< bool > EnableLoadStoreOpt("aarch64-enable-ldst-opt", cl::desc("Enable the load/store pair"" optimization pass"), cl::init(true), cl::Hidden)
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.
void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry &)
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
FunctionPass * createAArch64DeadRegisterDefinitions()
StringRef - Represent a constant reference to a string, i.e.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static cl::opt< bool > BranchRelaxation("aarch64-enable-branch-relax", cl::Hidden, cl::init(true), cl::desc("Relax out of range conditional branches"))
FunctionPass * createAtomicExpandPass()
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
static cl::opt< bool > EnableStPairSuppress("aarch64-enable-stp-suppress", cl::desc("Suppress STP for AArch64"), cl::init(true), cl::Hidden)
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void initializeAArch64AdvSIMDScalarPass(PassRegistry &)
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
void initializeAArch64StorePairSuppressPass(PassRegistry &)