LLVM  8.0.0svn
ARMTargetMachine.cpp
Go to the documentation of this file.
1 //===-- ARMTargetMachine.cpp - Define TargetMachine for ARM ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "ARMTargetMachine.h"
14 #include "ARM.h"
15 #include "ARMMacroFusion.h"
16 #include "ARMSubtarget.h"
17 #include "ARMTargetObjectFile.h"
18 #include "ARMTargetTransformInfo.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/STLExtras.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/ADT/Triple.h"
36 #include "llvm/CodeGen/Passes.h"
38 #include "llvm/IR/Attributes.h"
39 #include "llvm/IR/DataLayout.h"
40 #include "llvm/IR/Function.h"
41 #include "llvm/Pass.h"
42 #include "llvm/Support/CodeGen.h"
49 #include "llvm/Transforms/Scalar.h"
50 #include <cassert>
51 #include <memory>
52 #include <string>
53 
54 using namespace llvm;
55 
56 static cl::opt<bool>
57 DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden,
58  cl::desc("Inhibit optimization of S->D register accesses on A15"),
59  cl::init(false));
60 
61 static cl::opt<bool>
62 EnableAtomicTidy("arm-atomic-cfg-tidy", cl::Hidden,
63  cl::desc("Run SimplifyCFG after expanding atomic operations"
64  " to make use of cmpxchg flow-based information"),
65  cl::init(true));
66 
67 static cl::opt<bool>
68 EnableARMLoadStoreOpt("arm-load-store-opt", cl::Hidden,
69  cl::desc("Enable ARM load/store optimization pass"),
70  cl::init(true));
71 
72 // FIXME: Unify control over GlobalMerge.
74 EnableGlobalMerge("arm-global-merge", cl::Hidden,
75  cl::desc("Enable the global merge pass"));
76 
77 namespace llvm {
79 }
80 
81 extern "C" void LLVMInitializeARMTarget() {
82  // Register the target.
87 
89  initializeGlobalISel(Registry);
98 }
99 
100 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
101  if (TT.isOSBinFormatMachO())
102  return llvm::make_unique<TargetLoweringObjectFileMachO>();
103  if (TT.isOSWindows())
104  return llvm::make_unique<TargetLoweringObjectFileCOFF>();
105  return llvm::make_unique<ARMElfTargetObjectFile>();
106 }
107 
110  const TargetOptions &Options) {
111  StringRef ABIName = Options.MCOptions.getABIName();
112 
113  if (ABIName.empty())
114  ABIName = ARM::computeDefaultTargetABI(TT, CPU);
115 
116  if (ABIName == "aapcs16")
118  else if (ABIName.startswith("aapcs"))
120  else if (ABIName.startswith("apcs"))
122 
123  llvm_unreachable("Unhandled/unknown ABI Name!");
125 }
126 
127 static std::string computeDataLayout(const Triple &TT, StringRef CPU,
128  const TargetOptions &Options,
129  bool isLittle) {
130  auto ABI = computeTargetABI(TT, CPU, Options);
131  std::string Ret;
132 
133  if (isLittle)
134  // Little endian.
135  Ret += "e";
136  else
137  // Big endian.
138  Ret += "E";
139 
141 
142  // Pointers are 32 bits and aligned to 32 bits.
143  Ret += "-p:32:32";
144 
145  // ABIs other than APCS have 64 bit integers with natural alignment.
147  Ret += "-i64:64";
148 
149  // We have 64 bits floats. The APCS ABI requires them to be aligned to 32
150  // bits, others to 64 bits. We always try to align to 64 bits.
152  Ret += "-f64:32:64";
153 
154  // We have 128 and 64 bit vectors. The APCS ABI aligns them to 32 bits, others
155  // to 64. We always ty to give them natural alignment.
157  Ret += "-v64:32:64-v128:32:128";
159  Ret += "-v128:64:128";
160 
161  // Try to align aggregates to 32 bits (the default is 64 bits, which has no
162  // particular hardware support on 32-bit ARM).
163  Ret += "-a:0:32";
164 
165  // Integer registers are 32 bits.
166  Ret += "-n32";
167 
168  // The stack is 128 bit aligned on NaCl, 64 bit aligned on AAPCS and 32 bit
169  // aligned everywhere else.
171  Ret += "-S128";
172  else if (ABI == ARMBaseTargetMachine::ARM_ABI_AAPCS)
173  Ret += "-S64";
174  else
175  Ret += "-S32";
176 
177  return Ret;
178 }
179 
182  if (!RM.hasValue())
183  // Default relocation model on Darwin is PIC.
185 
186  if (*RM == Reloc::ROPI || *RM == Reloc::RWPI || *RM == Reloc::ROPI_RWPI)
187  assert(TT.isOSBinFormatELF() &&
188  "ROPI/RWPI currently only supported for ELF");
189 
190  // DynamicNoPIC is only used on darwin.
191  if (*RM == Reloc::DynamicNoPIC && !TT.isOSDarwin())
192  return Reloc::Static;
193 
194  return *RM;
195 }
196 
198  if (CM)
199  return *CM;
200  return CodeModel::Small;
201 }
202 
203 /// Create an ARM architecture model.
204 ///
206  StringRef CPU, StringRef FS,
207  const TargetOptions &Options,
210  CodeGenOpt::Level OL, bool isLittle)
211  : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
212  CPU, FS, Options, getEffectiveRelocModel(TT, RM),
213  getEffectiveCodeModel(CM), OL),
214  TargetABI(computeTargetABI(TT, CPU, Options)),
215  TLOF(createTLOF(getTargetTriple())), isLittle(isLittle) {
216 
217  // Default to triple-appropriate float ABI
218  if (Options.FloatABIType == FloatABI::Default) {
219  if (isTargetHardFloat())
220  this->Options.FloatABIType = FloatABI::Hard;
221  else
222  this->Options.FloatABIType = FloatABI::Soft;
223  }
224 
225  // Default to triple-appropriate EABI
226  if (Options.EABIVersion == EABI::Default ||
227  Options.EABIVersion == EABI::Unknown) {
228  // musl is compatible with glibc with regard to EABI version
234  this->Options.EABIVersion = EABI::GNU;
235  else
236  this->Options.EABIVersion = EABI::EABI5;
237  }
238 
239  if (TT.isOSBinFormatMachO()) {
240  this->Options.TrapUnreachable = true;
241  this->Options.NoTrapAfterNoreturn = true;
242  }
243 
244  initAsmInfo();
245 }
246 
248 
249 const ARMSubtarget *
251  Attribute CPUAttr = F.getFnAttribute("target-cpu");
252  Attribute FSAttr = F.getFnAttribute("target-features");
253 
254  std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
255  ? CPUAttr.getValueAsString().str()
256  : TargetCPU;
257  std::string FS = !FSAttr.hasAttribute(Attribute::None)
258  ? FSAttr.getValueAsString().str()
259  : TargetFS;
260 
261  // FIXME: This is related to the code below to reset the target options,
262  // we need to know whether or not the soft float flag is set on the
263  // function before we can generate a subtarget. We also need to use
264  // it as a key for the subtarget since that can be the only difference
265  // between two functions.
266  bool SoftFloat =
267  F.getFnAttribute("use-soft-float").getValueAsString() == "true";
268  // If the soft float attribute is set on the function turn on the soft float
269  // subtarget feature.
270  if (SoftFloat)
271  FS += FS.empty() ? "+soft-float" : ",+soft-float";
272 
273  auto &I = SubtargetMap[CPU + FS];
274  if (!I) {
275  // This needs to be done before we create a new subtarget since any
276  // creation will depend on the TM and the code generation flags on the
277  // function that reside in TargetOptions.
279  I = llvm::make_unique<ARMSubtarget>(TargetTriple, CPU, FS, *this, isLittle);
280 
281  if (!I->isThumb() && !I->hasARMOps())
282  F.getContext().emitError("Function '" + F.getName() + "' uses ARM "
283  "instructions, but the target does not support ARM mode execution.");
284  }
285 
286  return I.get();
287 }
288 
291  return TargetTransformInfo(ARMTTIImpl(this, F));
292 }
293 
295  StringRef CPU, StringRef FS,
296  const TargetOptions &Options,
299  CodeGenOpt::Level OL, bool JIT)
300  : ARMBaseTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
301 
303  StringRef CPU, StringRef FS,
304  const TargetOptions &Options,
307  CodeGenOpt::Level OL, bool JIT)
308  : ARMBaseTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
309 
310 namespace {
311 
312 /// ARM Code Generator Pass Configuration Options.
313 class ARMPassConfig : public TargetPassConfig {
314 public:
315  ARMPassConfig(ARMBaseTargetMachine &TM, PassManagerBase &PM)
316  : TargetPassConfig(TM, PM) {
317  if (TM.getOptLevel() != CodeGenOpt::None) {
320  if (STI.hasFeature(ARM::FeatureUseMISched))
321  substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
322  }
323  }
324 
325  ARMBaseTargetMachine &getARMTargetMachine() const {
326  return getTM<ARMBaseTargetMachine>();
327  }
328 
330  createMachineScheduler(MachineSchedContext *C) const override {
332  // add DAG Mutations here.
333  const ARMSubtarget &ST = C->MF->getSubtarget<ARMSubtarget>();
334  if (ST.hasFusion())
336  return DAG;
337  }
338 
340  createPostMachineScheduler(MachineSchedContext *C) const override {
342  // add DAG Mutations here.
343  const ARMSubtarget &ST = C->MF->getSubtarget<ARMSubtarget>();
344  if (ST.hasFusion())
346  return DAG;
347  }
348 
349  void addIRPasses() override;
350  void addCodeGenPrepare() override;
351  bool addPreISel() override;
352  bool addInstSelector() override;
353  bool addIRTranslator() override;
354  bool addLegalizeMachineIR() override;
355  bool addRegBankSelect() override;
356  bool addGlobalInstructionSelect() override;
357  void addPreRegAlloc() override;
358  void addPreSched2() override;
359  void addPreEmitPass() override;
360 };
361 
362 class ARMExecutionDomainFix : public ExecutionDomainFix {
363 public:
364  static char ID;
365  ARMExecutionDomainFix() : ExecutionDomainFix(ID, ARM::DPRRegClass) {}
366  StringRef getPassName() const override {
367  return "ARM Execution Domain Fix";
368  }
369 };
371 
372 } // end anonymous namespace
373 
374 INITIALIZE_PASS_BEGIN(ARMExecutionDomainFix, "arm-execution-domain-fix",
375  "ARM Execution Domain Fix", false, false)
377 INITIALIZE_PASS_END(ARMExecutionDomainFix, "arm-execution-domain-fix",
378  "ARM Execution Domain Fix", false, false)
379 
381  return new ARMPassConfig(*this, PM);
382 }
383 
384 void ARMPassConfig::addIRPasses() {
385  if (TM->Options.ThreadModel == ThreadModel::Single)
386  addPass(createLowerAtomicPass());
387  else
388  addPass(createAtomicExpandPass());
389 
390  // Cmpxchg instructions are often used with a subsequent comparison to
391  // determine whether it succeeded. We can exploit existing control-flow in
392  // ldrex/strex loops to simplify this, but it needs tidying up.
393  if (TM->getOptLevel() != CodeGenOpt::None && EnableAtomicTidy)
395  1, false, false, true, true, [this](const Function &F) {
396  const auto &ST = this->TM->getSubtarget<ARMSubtarget>(F);
397  return ST.hasAnyDataBarrier() && !ST.isThumb1Only();
398  }));
399 
401 
402  // Match interleaved memory accesses to ldN/stN intrinsics.
403  if (TM->getOptLevel() != CodeGenOpt::None)
404  addPass(createInterleavedAccessPass());
405 }
406 
407 void ARMPassConfig::addCodeGenPrepare() {
408  if (getOptLevel() != CodeGenOpt::None)
409  addPass(createARMCodeGenPreparePass());
411 }
412 
413 bool ARMPassConfig::addPreISel() {
414  if (getOptLevel() != CodeGenOpt::None)
415  addPass(createARMParallelDSPPass());
416 
417  if ((TM->getOptLevel() != CodeGenOpt::None &&
419  EnableGlobalMerge == cl::BOU_TRUE) {
420  // FIXME: This is using the thumb1 only constant value for
421  // maximal global offset for merging globals. We may want
422  // to look into using the old value for non-thumb1 code of
423  // 4095 based on the TargetMachine, but this starts to become
424  // tricky when doing code gen per function.
425  bool OnlyOptimizeForSize = (TM->getOptLevel() < CodeGenOpt::Aggressive) &&
426  (EnableGlobalMerge == cl::BOU_UNSET);
427  // Merging of extern globals is enabled by default on non-Mach-O as we
428  // expect it to be generally either beneficial or harmless. On Mach-O it
429  // is disabled as we emit the .subsections_via_symbols directive which
430  // means that merging extern globals is not safe.
431  bool MergeExternalByDefault = !TM->getTargetTriple().isOSBinFormatMachO();
432  addPass(createGlobalMergePass(TM, 127, OnlyOptimizeForSize,
433  MergeExternalByDefault));
434  }
435 
436  return false;
437 }
438 
439 bool ARMPassConfig::addInstSelector() {
440  addPass(createARMISelDag(getARMTargetMachine(), getOptLevel()));
441  return false;
442 }
443 
444 bool ARMPassConfig::addIRTranslator() {
445  addPass(new IRTranslator());
446  return false;
447 }
448 
449 bool ARMPassConfig::addLegalizeMachineIR() {
450  addPass(new Legalizer());
451  return false;
452 }
453 
454 bool ARMPassConfig::addRegBankSelect() {
455  addPass(new RegBankSelect());
456  return false;
457 }
458 
459 bool ARMPassConfig::addGlobalInstructionSelect() {
460  addPass(new InstructionSelect());
461  return false;
462 }
463 
464 void ARMPassConfig::addPreRegAlloc() {
465  if (getOptLevel() != CodeGenOpt::None) {
466  addPass(createMLxExpansionPass());
467 
469  addPass(createARMLoadStoreOptimizationPass(/* pre-register alloc */ true));
470 
472  addPass(createA15SDOptimizerPass());
473  }
474 }
475 
476 void ARMPassConfig::addPreSched2() {
477  if (getOptLevel() != CodeGenOpt::None) {
480 
481  addPass(new ARMExecutionDomainFix());
482  addPass(createBreakFalseDeps());
483  }
484 
485  // Expand some pseudo instructions into multiple instructions to allow
486  // proper scheduling.
487  addPass(createARMExpandPseudoPass());
488 
489  if (getOptLevel() != CodeGenOpt::None) {
490  // in v8, IfConversion depends on Thumb instruction widths
491  addPass(createThumb2SizeReductionPass([this](const Function &F) {
492  return this->TM->getSubtarget<ARMSubtarget>(F).restrictIT();
493  }));
494 
495  addPass(createIfConverter([](const MachineFunction &MF) {
496  return !MF.getSubtarget<ARMSubtarget>().isThumb1Only();
497  }));
498  }
499  addPass(createThumb2ITBlockPass());
500 }
501 
502 void ARMPassConfig::addPreEmitPass() {
504 
505  // Constant island pass work on unbundled instructions.
506  addPass(createUnpackMachineBundles([](const MachineFunction &MF) {
507  return MF.getSubtarget<ARMSubtarget>().isThumb2();
508  }));
509 
510  // Don't optimize barriers at -O0.
511  if (getOptLevel() != CodeGenOpt::None)
513 
514  addPass(createARMConstantIslandPass());
515 }
uint64_t CallInst * C
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
Definition: Triple.h:471
StringRef getTargetFeatureString() const
static ARMBaseTargetMachine::ARMABI computeTargetABI(const Triple &TT, StringRef CPU, const TargetOptions &Options)
FunctionPass * createA15SDOptimizerPass()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
FunctionPass * createMLxExpansionPass()
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:228
MCTargetOptions MCOptions
Machine level options.
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
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))
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:589
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
Definition: TargetMachine.h:78
EABI EABIVersion
EABIVersion - This flag specifies the EABI version.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:45
FunctionPass * createARMExpandPseudoPass()
createARMExpandPseudoPass - returns an instance of the pseudo instruction expansion pass...
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
Definition: Triple.h:568
void initializeARMPreAllocLoadStoreOptPass(PassRegistry &)
void initializeARMExecutionDomainFixPass(PassRegistry &)
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...
F(f)
setjmp/longjmp based exceptions
block Block Frequency true
Target & getTheThumbLETarget()
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
unsigned NoTrapAfterNoreturn
Do not emit a trap instruction for &#39;unreachable&#39; IR instructions behind noreturn calls, even if TrapUnreachable is true.
static const char * getManglingComponent(const Triple &T)
Definition: DataLayout.cpp:157
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
This class provides the reaching def analysis.
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)
#define INITIALIZE_PASS_DEPENDENCY(depName)
Definition: PassSupport.h:51
ARMBaseTargetMachine(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 isLittle)
Create an ARM architecture model.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function&#39;s attributes.
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
Definition: Attributes.h:72
Target & getTheARMBETarget()
Target-Independent Code Generator Pass Configuration Options.
void initializeARMCodeGenPreparePass(PassRegistry &)
FunctionPass * createARMConstantIslandPass()
createARMConstantIslandPass - returns an instance of the constpool island pass.
void emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
This file a TargetTransformInfo::Concept conforming object specific to the ARM target machine...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:267
const MCSubtargetInfo * STI
Definition: TargetMachine.h:91
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
void LLVMInitializeARMTarget()
Target & getTheThumbBETarget()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:133
StringMap< std::unique_ptr< ARMSubtarget > > SubtargetMap
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.
StringRef getTargetCPU() const
static std::string computeDataLayout(const Triple &TT, StringRef CPU, const TargetOptions &Options, bool isLittle)
static CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM)
speculative execution
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:563
ARMBETargetMachine(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)
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:410
void initializeARMExpandPseudoPass(PassRegistry &)
void initializeARMLoadStoreOptPass(PassRegistry &)
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
Definition: Attributes.cpp:202
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 GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Pass * createARMParallelDSPPass()
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
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.
Definition: RegBankSelect.h:91
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))
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
void initializeARMParallelDSPPass(PassRegistry &)
FunctionPass * createBreakFalseDeps()
Creates Break False Dependencies pass.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
const Triple & getTargetTriple() const
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition: Triple.h:599
static cl::opt< cl::boolOrDefault > EnableGlobalMerge("arm-global-merge", cl::Hidden, cl::desc("Enable the global merge pass"))
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
Definition: Function.cpp:194
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
FunctionPass * createARMLoadStoreOptimizationPass(bool PreAlloc=false)
Returns an instance of the load / store optimization pass.
INITIALIZE_PASS_BEGIN(ARMExecutionDomainFix, "arm-execution-domain-fix", "ARM Execution Domain Fix", false, false) INITIALIZE_PASS_END(ARMExecutionDomainFix
char & PostRASchedulerID
createPostRAScheduler - This pass performs post register allocation scheduling.
void initializeThumb2SizeReducePass(PassRegistry &)
arm execution domain fix
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
arm execution domain ARM Execution Domain Fix
StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU)
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
Definition: Triple.h:304
Pass * createLowerAtomicPass()
void initializeARMConstantIslandsPass(PassRegistry &)
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.
std::string TargetCPU
Definition: TargetMachine.h:79
A ScheduleDAG for scheduling lists of MachineInstr.
bool hasValue() const
Definition: Optional.h:187
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.
StringRef getValueAsString() const
Return the attribute&#39;s value as a string.
Definition: Attributes.cpp:195
StringRef getName() const
Return a constant reference to the value&#39;s name.
Definition: Value.cpp:224
TargetOptions Options
Definition: TargetMachine.h:98
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
#define I(x, y, z)
Definition: MD5.cpp:58
bool hasFeature(unsigned Feature) const
const ARMSubtarget * getSubtargetImpl() const =delete
std::string TargetFS
Definition: TargetMachine.h:80
FunctionPass * createARMISelDag(ARMBaseTargetMachine &TM, CodeGenOpt::Level OptLevel)
createARMISelDag - This pass converts a legalized DAG into a ARM-specific DAG, ready for instruction ...
This file declares the IRTranslator pass.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
FunctionPass * createARMCodeGenPreparePass()
This file describes how to lower LLVM calls to machine code calls.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
Definition: Function.h:331
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:39
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
Definition: ARMSubtarget.h:636
unsigned TrapUnreachable
Emit target-specific trap instruction for &#39;unreachable&#39; IR instructions.
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 pass exposes codegen information to IR-level passes.
Target & getTheARMLETarget()
FunctionPass * createAtomicExpandPass()
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
Definition: GlobalISel.cpp:19
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
ARMLETargetMachine(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)
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line...