58 cl::desc(
"Inhibit optimization of S->D register accesses on A15"),
63 cl::desc(
"Run SimplifyCFG after expanding atomic operations"
64 " to make use of cmpxchg flow-based information"),
69 cl::desc(
"Enable ARM load/store optimization pass"),
75 cl::desc(
"Enable the global merge pass"));
98 return llvm::make_unique<TargetLoweringObjectFileMachO>();
100 return llvm::make_unique<TargetLoweringObjectFileCOFF>();
101 return llvm::make_unique<ARMElfTargetObjectFile>();
112 if (ABIName ==
"aapcs16")
153 Ret +=
"-v64:32:64-v128:32:128";
155 Ret +=
"-v128:64:128";
184 "ROPI/RWPI currently only supported for ELF");
205 TLOF(
createTLOF(getTargetTriple())), isLittle(isLittle) {
260 FS += FS.
empty() ?
"+soft-float" :
",+soft-float";
305 return getTM<ARMBaseTargetMachine>();
328 void addIRPasses()
override;
329 bool addPreISel()
override;
330 bool addInstSelector()
override;
331 #ifdef LLVM_BUILD_GLOBAL_ISEL
332 bool addIRTranslator()
override;
333 bool addLegalizeMachineIR()
override;
334 bool addRegBankSelect()
override;
335 bool addGlobalInstructionSelect()
override;
337 void addPreRegAlloc()
override;
338 void addPreSched2()
override;
339 void addPreEmitPass()
override;
347 return "ARM Execution Dependency Fix";
355 "ARM Execution Dependency Fix",
false,
false)
358 return new ARMPassConfig(*
this, PM);
361 void ARMPassConfig::addIRPasses() {
383 bool ARMPassConfig::addPreISel() {
398 bool MergeExternalByDefault = !
TM->getTargetTriple().isOSBinFormatMachO();
400 MergeExternalByDefault));
406 bool ARMPassConfig::addInstSelector() {
411 #ifdef LLVM_BUILD_GLOBAL_ISEL
412 bool ARMPassConfig::addIRTranslator() {
417 bool ARMPassConfig::addLegalizeMachineIR() {
422 bool ARMPassConfig::addRegBankSelect() {
427 bool ARMPassConfig::addGlobalInstructionSelect() {
433 void ARMPassConfig::addPreRegAlloc() {
445 void ARMPassConfig::addPreSched2() {
450 addPass(
new ARMExecutionDepsFix());
470 void ARMPassConfig::addPreEmitPass() {
static ARMBaseTargetMachine::ARMABI computeTargetABI(const Triple &TT, StringRef CPU, const TargetOptions &Options)
FunctionPass * createA15SDOptimizerPass()
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
FunctionPass * createMLxExpansionPass()
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
TargetIRAnalysis getTargetIRAnalysis() override
Get the TargetIRAnalysis for this target.
MCTargetOptions MCOptions
Machine level options.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
static cl::opt< bool > EnableARMLoadStoreOpt("arm-load-store-opt", cl::Hidden, cl::desc("Enable ARM load/store optimization pass"), cl::init(true))
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
EABI EABIVersion
EABIVersion - This flag specifies the EABI version.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
FunctionPass * createARMExpandPseudoPass()
createARMExpandPseudoPass - returns an instance of the pseudo instruction expansion pass...
void initializeARMPreAllocLoadStoreOptPass(PassRegistry &)
Analysis pass providing the TargetTransformInfo.
ScheduleDAGMI * createGenericSchedPostRA(MachineSchedContext *C)
Create a generic scheduler with no vreg liveness or DAG mutation passes.
FunctionPass * createIfConverter(std::function< bool(const MachineFunction &)> Ftor)
FunctionPass * createARMOptimizeBarriersPass()
createARMOptimizeBarriersPass - Returns an instance of the remove double barriers pass...
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...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
setjmp/longjmp based exceptions
enum llvm::ARMBaseTargetMachine::ARMABI TargetABI
Target & getTheThumbLETarget()
bool isThumb1Only() const
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
ARMBaseTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle)
Create an ARM architecture model.
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...
INITIALIZE_PASS(ARMExecutionDepsFix,"arm-execution-deps-fix","ARM Execution Dependency Fix", false, false) TargetPassConfig *ARMBaseTargetMachine
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
Target & getTheARMBETarget()
Target-Independent Code Generator Pass Configuration Options.
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
FunctionPass * createARMConstantIslandPass()
createARMConstantIslandPass - returns an instance of the constpool island pass.
ARMBETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void LLVMInitializeARMTarget()
Target & getTheThumbBETarget()
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
StringMap< std::unique_ptr< ARMSubtarget > > SubtargetMap
bool hasAnyDataBarrier() const
std::unique_ptr< ScheduleDAGMutation > createARMMacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createARMMacroFusionDAGMutation()); to ARMPassConfig::crea...
ScheduleDAGMILive * createGenericSchedLive(MachineSchedContext *C)
Create the standard converging machine scheduler.
static std::string computeDataLayout(const Triple &TT, StringRef CPU, const TargetOptions &Options, bool isLittle)
Function Alias Analysis false
initializer< Ty > init(const Ty &Val)
void initializeARMLoadStoreOptPass(PassRegistry &)
void initializeARMExecutionDepsFixPass(PassRegistry &)
static cl::opt< bool > DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden, cl::desc("Inhibit optimization of S->D register accesses on A15"), cl::init(false))
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
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...
static cl::opt< cl::boolOrDefault > EnableGlobalMerge("arm-global-merge", cl::Hidden, cl::desc("Enable the global merge pass"))
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
cl::opt< std::string > ABIName("target-abi", cl::Hidden, cl::desc("The name of the ABI to be targeted from the backend."), cl::init(""))
Triple - Helper class for working with autoconf configuration names.
FunctionPass * createARMLoadStoreOptimizationPass(bool PreAlloc=false)
Returns an instance of the load / store optimization pass.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU)
Pass * createLowerAtomicPass()
void initializeARMConstantIslandsPass(PassRegistry &)
FunctionPass * createUnpackMachineBundles(std::function< bool(const MachineFunction &)> Ftor)
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...
Target - Wrapper for Target specific information.
ARMLETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
llvm_unreachable("Unknown RegBank!")
A ScheduleDAG for scheduling lists of MachineInstr.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
~ARMBaseTargetMachine() override
static cl::opt< bool > EnableAtomicTidy("arm-atomic-cfg-tidy", cl::Hidden, cl::desc("Run SimplifyCFG after expanding atomic operations"" to make use of cmpxchg flow-based information"), cl::init(true))
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.
const ARMSubtarget * getSubtargetImpl() const =delete
FunctionPass * createARMISelDag(ARMBaseTargetMachine &TM, CodeGenOpt::Level OptLevel)
createARMISelDag - This pass converts a legalized DAG into a ARM-specific DAG, ready for instruction ...
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
This file describes how to lower LLVM calls to machine code calls.
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
FunctionPass * createThumb2SizeReductionPass(std::function< bool(const Function &)> Ftor=nullptr)
createThumb2SizeReductionPass - Returns an instance of the Thumb2 size reduction pass.
FunctionPass * createThumb2ITBlockPass()
createThumb2ITBlockPass - Returns an instance of the Thumb2 IT blocks insertion pass.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
Target & getTheARMLETarget()
FunctionPass * createAtomicExpandPass()
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.
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line...