51 cl::desc(
"Enable the CCMP formation pass"),
56 cl::desc(
"Enable the conditional branch tuning pass"),
60 cl::desc(
"Enable the machine combiner pass"),
64 cl::desc(
"Suppress STP for AArch64"),
68 "aarch64-enable-simd-scalar",
69 cl::desc(
"Enable use of AdvSIMD scalar integer instructions"),
74 cl::desc(
"Enable the promote constant pass"),
78 "aarch64-enable-collect-loh",
79 cl::desc(
"Enable the pass that emits the linker optimization hints (LOH)"),
84 cl::desc(
"Enable the pass that removes dead" 85 " definitons and replaces stores to" 86 " them with stores to the zero" 91 "aarch64-enable-copyelim",
96 cl::desc(
"Enable the load/store pair" 97 " optimization pass"),
102 cl::desc(
"Run SimplifyCFG after expanding atomic operations" 103 " to make use of cmpxchg flow-based information"),
108 cl::desc(
"Run early if-conversion"),
113 cl::desc(
"Enable the condition optimizer pass"),
118 cl::desc(
"Work around Cortex-A53 erratum 835769"),
123 cl::desc(
"Enable optimizations on complex GEPs"),
128 cl::desc(
"Relax out of range conditional branches"));
132 cl::desc(
"Use smallest entry possible for jump tables"));
137 cl::desc(
"Enable the global merge pass"));
141 cl::desc(
"Enable the loop data prefetch pass"),
145 "aarch64-enable-global-isel-at-O",
cl::Hidden,
146 cl::desc(
"Enable GlobalISel at or below an opt level (-1 to disable)"),
154 cl::desc(
"Enable the AAcrh64 branch target pass"),
195 return std::make_unique<AArch64_MachoTargetObjectFile>();
197 return std::make_unique<AArch64_COFFTargetObjectFile>();
199 return std::make_unique<AArch64_ELFTargetObjectFile>();
207 return "e-m:e-p:32:32-i8:8-i16:16-i64:64-S128";
210 return "e-m:o-p:32:32-i64:64-i128:128-n32:64-S128";
211 return "e-m:o-i64:64-i128:128-n32:64-S128";
214 return "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128";
216 return "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
217 return "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
241 "Only small, tiny and large code models are allowed on AArch64");
244 "are allowed on AArch64");
273 TLOF(
createTLOF(getTargetTriple())), isLittle(LittleEndian) {
291 if (this->Options.
TLSSize == 0)
344 void AArch64leTargetMachine::anchor() { }
352 void AArch64beTargetMachine::anchor() { }
372 return getTM<AArch64TargetMachine>();
400 void addIRPasses()
override;
401 bool addPreISel()
override;
402 bool addInstSelector()
override;
403 bool addIRTranslator()
override;
404 void addPreLegalizeMachineIR()
override;
405 bool addLegalizeMachineIR()
override;
406 bool addRegBankSelect()
override;
407 void addPreGlobalInstructionSelect()
override;
408 bool addGlobalInstructionSelect()
override;
409 bool addILPOpts()
override;
410 void addPreRegAlloc()
override;
411 void addPostRegAlloc()
override;
412 void addPreSched2()
override;
413 void addPreEmitPass()
override;
415 std::unique_ptr<CSEConfigBase> getCSEConfig()
const override;
426 return new AArch64PassConfig(*
this, PM);
429 std::unique_ptr<CSEConfigBase> AArch64PassConfig::getCSEConfig()
const {
433 void AArch64PassConfig::addIRPasses() {
480 if (
TM->getTargetTriple().isOSWindows())
485 bool AArch64PassConfig::addPreISel() {
503 bool MergeExternalByDefault = !
TM->getTargetTriple().isOSBinFormatMachO();
507 if (!OnlyOptimizeForSize)
508 MergeExternalByDefault =
false;
511 MergeExternalByDefault));
517 bool AArch64PassConfig::addInstSelector() {
522 if (
TM->getTargetTriple().isOSBinFormatELF() &&
529 bool AArch64PassConfig::addIRTranslator() {
534 void AArch64PassConfig::addPreLegalizeMachineIR() {
539 bool AArch64PassConfig::addLegalizeMachineIR() {
544 bool AArch64PassConfig::addRegBankSelect() {
549 void AArch64PassConfig::addPreGlobalInstructionSelect() {
553 bool AArch64PassConfig::addGlobalInstructionSelect() {
558 bool AArch64PassConfig::addILPOpts() {
577 void AArch64PassConfig::addPreRegAlloc() {
591 void AArch64PassConfig::addPostRegAlloc() {
601 void AArch64PassConfig::addPreSched2() {
623 void AArch64PassConfig::addPreEmitPass() {
642 if (
TM->getTargetTriple().isOSWindows())
649 TM->getTargetTriple().isOSBinFormatMachO())
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
bool usesWindowsCFI() const
Target & getTheAArch64beTarget()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
FunctionPass * createCFGuardCheckPass()
Insert Control FLow Guard checks on indirect function calls.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
void initializeAArch64A53Fix835769Pass(PassRegistry &)
AArch64beTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
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.
Target & getTheARM64_32Target()
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
FunctionPass * createFalkorMarkStridedAccessesPass()
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
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.
static cl::opt< bool > EnableCompressJumpTables("aarch64-enable-compress-jump-tables", cl::Hidden, cl::init(true), cl::desc("Use smallest entry possible for jump tables"))
char & EarlyIfConverterID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions...
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...
block Block Frequency true
FunctionPass * createAArch64ConditionalCompares()
void initializeAArch64RedundantCopyEliminationPass(PassRegistry &)
void setGlobalISelAbort(GlobalISelAbortMode Mode)
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
unsigned NoTrapAfterNoreturn
Do not emit a trap instruction for 'unreachable' IR instructions behind noreturn calls, even if TrapUnreachable is true.
ModulePass * createAArch64PromoteConstantPass()
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
static CodeModel::Model getEffectiveAArch64CodeModel(const Triple &TT, Optional< CodeModel::Model > CM, bool JIT)
FunctionPass * createLoopDataPrefetchPass()
FunctionPass * createCFGuardLongjmpPass()
Creates CFGuard longjmp target identification pass.
FunctionPass * createAArch64CollectLOHPass()
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
FunctionPass * createCFGSimplificationPass(unsigned Threshold=1, bool ForwardSwitchCond=false, bool ConvertSwitch=false, bool KeepLoops=true, bool SinkCommon=false, std::function< bool(const Function &)> Ftor=nullptr)
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
static cl::opt< bool > EnableEarlyIfConversion("aarch64-enable-early-ifcvt", cl::Hidden, cl::desc("Run early if-conversion"), cl::init(true))
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
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))
void initializeLDTLSCleanupPass(PassRegistry &)
FunctionPass * createAArch64StackTaggingPass(bool MergeInit)
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.
FunctionPass * createAArch64RedundantCopyEliminationPass()
Target & getTheARM64Target()
void initializeAArch64CollectLOHPass(PassRegistry &)
Target-Independent Code Generator Pass Configuration Options.
void initializeAArch64StackTaggingPreRAPass(PassRegistry &)
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
FunctionPass * createAArch64PreLegalizeCombiner(bool IsOptNone)
FunctionPass * createAArch64A57FPLoadBalancing()
static cl::opt< bool > EnableLoadStoreOpt("aarch64-enable-ldst-opt", cl::desc("Enable the load/store pair" " optimization pass"), cl::init(true), cl::Hidden)
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
static cl::opt< bool > EnableCondBrTuning("aarch64-enable-cond-br-tune", cl::desc("Enable the conditional branch tuning pass"), cl::init(true), cl::Hidden)
FunctionPass * createInterleavedLoadCombinePass()
InterleavedLoadCombines Pass - This pass identifies interleaved loads and combines them into wide loa...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
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)
void initializeAArch64SpeculationHardeningPass(PassRegistry &)
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...
AArch64TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT, bool IsLittleEndian)
Create an AArch64 architecture model.
bool isOSWindows() const
Tests whether the OS is Windows.
void initializeAArch64A57FPLoadBalancingPass(PassRegistry &)
std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOpt::Level Level)
initializer< Ty > init(const Ty &Val)
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
void initializeAArch64PromoteConstantPass(PassRegistry &)
void initializeAArch64ExpandPseudoPass(PassRegistry &)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Target & getTheAArch64_32Target()
unsigned TLSSize
Bit size of immediate TLS offsets (0 == use the default).
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
static cl::opt< bool > EnableBranchTargets("aarch64-enable-branch-targets", cl::Hidden, cl::desc("Enable the AAcrh64 branch target pass"), cl::init(true))
FunctionPass * createAArch64AdvSIMDScalar()
const AArch64Subtarget * getSubtargetImpl() const =delete
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass * createAArch64StackTaggingPreRAPass()
std::unique_ptr< ScheduleDAGMutation > createAArch64MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAArch64MacroFusionDAGMutation()); to AArch64PassConf...
void setMachineOutliner(bool Enable)
std::unique_ptr< ScheduleDAGMutation > createStoreClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
void setSupportsDefaultOutlining(bool Enable)
~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)
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))
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))
std::unique_ptr< ScheduleDAGMutation > createLoadClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Target()
static cl::opt< bool > EnableGEPOpt("aarch64-enable-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(false))
AArch64leTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
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(0))
FunctionPass * createAArch64ExpandPseudoPass()
Returns an instance of the pseudo instruction expansion pass.
FunctionPass * createAArch64SpeculationHardeningPass()
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 &)
#define LLVM_EXTERNAL_VISIBILITY
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))
FunctionPass * createAArch64A53Fix835769()
This pass is responsible for selecting generic machine instructions to target-specific instructions...
void initializeAArch64StackTaggingPass(PassRegistry &)
FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
Target - Wrapper for Target specific information.
CodeModel::Model getCodeModel() const
Returns the code model.
void initializeAArch64PreLegalizerCombinerPass(PassRegistry &)
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()
void initializeAArch64BranchTargetsPass(PassRegistry &)
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)
void initializeAArch64ConditionOptimizerPass(PassRegistry &)
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
StringMap< std::unique_ptr< AArch64Subtarget > > SubtargetMap
StringRef getValueAsString() const
Return the attribute's value as a string.
FunctionPass * createAArch64StorePairSuppressPass()
FunctionPass * createAArch64CondBrTuning()
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
void setGlobalISel(bool Enable)
FunctionPass * createFalkorHWPFFixPass()
FunctionPass * createAArch64BranchTargetsPass()
static cl::opt< bool > EnableCCMP("aarch64-enable-ccmp", cl::desc("Enable the CCMP formation pass"), cl::init(true), cl::Hidden)
void initializeAArch64ConditionalComparesPass(PassRegistry &)
void initializeAArch64CompressJumpTablesPass(PassRegistry &)
This file declares the IRTranslator pass.
FunctionPass * createAArch64SIMDInstrOptPass()
Returns an instance of the high cost ASIMD instruction replacement optimization pass.
void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry &)
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
FunctionPass * createAArch64DeadRegisterDefinitions()
StringRef - Represent a constant reference to a string, i.e.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
static cl::opt< bool > BranchRelaxation("aarch64-enable-branch-relax", cl::Hidden, cl::init(true), cl::desc("Relax out of range conditional branches"))
FunctionPass * createAtomicExpandPass()
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 initializeAArch64SIMDInstrOptPass(PassRegistry &)
void initializeAArch64AdvSIMDScalarPass(PassRegistry &)
FunctionPass * createAArch64CompressJumpTablesPass()
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
void initializeAArch64StorePairSuppressPass(PassRegistry &)