41 cl::desc(
"Inhibit optimization of S->D register accesses on A15"),
46 cl::desc(
"Run SimplifyCFG after expanding atomic operations"
47 " to make use of cmpxchg flow-based information"),
52 cl::desc(
"Enable ARM load/store optimization pass"),
58 cl::desc(
"Enable the global merge pass"));
75 return make_unique<TargetLoweringObjectFileMachO>();
77 return make_unique<TargetLoweringObjectFileCOFF>();
78 return make_unique<ARMElfTargetObjectFile>();
92 "Unknown target-abi option!");
144 std::string
Ret =
"";
170 Ret +=
"-v64:32:64-v128:32:128";
172 Ret +=
"-v128:64:128";
201 "ROPI/RWPI currently only supported for ELF");
223 Subtarget(TT, CPU, FS, *this, isLittle), isLittle(isLittle) {
243 #ifdef LLVM_BUILD_GLOBAL_ISEL
246 std::unique_ptr<CallLowering> CallLoweringInfo;
247 std::unique_ptr<InstructionSelector> InstSelector;
248 std::unique_ptr<LegalizerInfo>
Legalizer;
249 std::unique_ptr<RegisterBankInfo> RegBankInfo;
251 return CallLoweringInfo.get();
254 return InstSelector.get();
260 return RegBankInfo.get();
288 FS += FS.
empty() ?
"+soft-float" :
",+soft-float";
298 #ifndef LLVM_BUILD_GLOBAL_ISEL
301 ARMGISelActualAccessor *GISel =
new ARMGISelActualAccessor();
302 GISel->CallLoweringInfo.reset(
new ARMCallLowering(*
I->getTargetLowering()));
312 GISel->RegBankInfo.reset(RBI);
314 I->setGISelAccessor(*GISel);
325 void ARMTargetMachine::anchor() {}
337 "support ARM mode execution!");
340 void ARMLETargetMachine::anchor() {}
350 void ARMBETargetMachine::anchor() {}
360 void ThumbTargetMachine::anchor() {}
372 void ThumbLETargetMachine::anchor() {}
382 void ThumbBETargetMachine::anchor() {}
400 return getTM<ARMBaseTargetMachine>();
403 void addIRPasses()
override;
404 bool addPreISel()
override;
405 bool addInstSelector()
override;
406 #ifdef LLVM_BUILD_GLOBAL_ISEL
407 bool addIRTranslator()
override;
408 bool addLegalizeMachineIR()
override;
409 bool addRegBankSelect()
override;
410 bool addGlobalInstructionSelect()
override;
412 void addPreRegAlloc()
override;
413 void addPreSched2()
override;
414 void addPreEmitPass()
override;
419 return new ARMPassConfig(
this, PM);
422 void ARMPassConfig::addIRPasses() {
434 return ST.hasAnyDataBarrier() && !
ST.isThumb1Only();
444 bool ARMPassConfig::addPreISel() {
459 bool MergeExternalByDefault = !
TM->getTargetTriple().isOSBinFormatMachO();
461 MergeExternalByDefault));
467 bool ARMPassConfig::addInstSelector() {
472 #ifdef LLVM_BUILD_GLOBAL_ISEL
473 bool ARMPassConfig::addIRTranslator() {
478 bool ARMPassConfig::addLegalizeMachineIR() {
483 bool ARMPassConfig::addRegBankSelect() {
488 bool ARMPassConfig::addGlobalInstructionSelect() {
494 void ARMPassConfig::addPreRegAlloc() {
506 void ARMPassConfig::addPreSched2() {
531 void ARMPassConfig::addPreEmitPass() {
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
static ARMBaseTargetMachine::ARMABI computeTargetABI(const Triple &TT, StringRef CPU, const TargetOptions &Options)
The goal of this helper class is to gather the accessor to all the APIs related to GlobalISel...
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.
unsigned parseCPUArch(StringRef CPU)
TargetIRAnalysis getTargetIRAnalysis() override
Get the TargetIRAnalysis for this target.
MCTargetOptions MCOptions
Machine level options.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
const std::string & getCPUString() const
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 &)
This class provides the information for the target register banks.
Analysis pass providing the TargetTransformInfo.
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.
Target & getTheThumbLETarget()
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
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.
Holds all the information related to register banks.
StringRef getArchName(unsigned ArchKind)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void initializeGlobalISel(PassRegistry &Registry)
Initialize all passes linked into the GlobalISel library.
FunctionPass * createAtomicExpandPass(const TargetMachine *TM)
No attributes have been set.
ThumbBETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Target & getTheARMBETarget()
Target-Independent Code Generator Pass Configuration Options.
ThumbLETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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)
Function Alias Analysis false
This class provides the information for the target register banks.
StringMap< std::unique_ptr< ARMSubtarget > > SubtargetMap
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
FunctionPass * createInterleavedAccessPass(const TargetMachine *TM)
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
static std::string computeDataLayout(const Triple &TT, StringRef CPU, const TargetOptions &Options, bool isLittle)
initializer< Ty > init(const Ty &Val)
void initializeARMLoadStoreOptPass(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))
This file declares the targeting of the RegisterBankInfo class for ARM.
bool isTargetHardFloat() const
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
const ARMSubtarget * getSubtargetImpl() const
This file declares the targeting of the Machinelegalizer class for ARM.
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
ARMTargetMachine(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)
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.
Triple - Helper class for working with autoconf configuration names.
FunctionPass * createARMLoadStoreOptimizationPass(bool PreAlloc=false)
Returns an instance of the load / store optimization pass.
ThumbTargetMachine(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)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
FunctionPass * createExecutionDependencyFixPass(const TargetRegisterClass *RC)
createExecutionDependencyFixPass - This pass fixes execution time problems with dependent instruction...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Pass * createLowerAtomicPass()
FunctionPass * createUnpackMachineBundles(std::function< bool(const MachineFunction &)> Ftor)
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.
bool isTargetGNUAEABI() const
Provides the logic to select generic machine instructions.
This file declares the targeting of the InstructionSelector class for ARM.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
~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))
unsigned parseArchProfile(StringRef Arch)
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
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.
bool isTargetMuslAEABI() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
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.
This file describes how to lower LLVM calls to machine code calls.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
Target & getTheARMLETarget()
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line...