LLVM  10.0.0
ARMTargetMachine.cpp
Go to the documentation of this file.
1 //===-- ARMTargetMachine.cpp - Define TargetMachine for ARM ---------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //
10 //===----------------------------------------------------------------------===//
11 
12 #include "ARMTargetMachine.h"
13 #include "ARM.h"
14 #include "ARMMacroFusion.h"
15 #include "ARMSubtarget.h"
16 #include "ARMTargetObjectFile.h"
17 #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"
50 #include "llvm/Transforms/Scalar.h"
51 #include <cassert>
52 #include <memory>
53 #include <string>
54 
55 using namespace llvm;
56 
57 static cl::opt<bool>
58 DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden,
59  cl::desc("Inhibit optimization of S->D register accesses on A15"),
60  cl::init(false));
61 
62 static cl::opt<bool>
63 EnableAtomicTidy("arm-atomic-cfg-tidy", cl::Hidden,
64  cl::desc("Run SimplifyCFG after expanding atomic operations"
65  " to make use of cmpxchg flow-based information"),
66  cl::init(true));
67 
68 static cl::opt<bool>
69 EnableARMLoadStoreOpt("arm-load-store-opt", cl::Hidden,
70  cl::desc("Enable ARM load/store optimization pass"),
71  cl::init(true));
72 
73 // FIXME: Unify control over GlobalMerge.
75 EnableGlobalMerge("arm-global-merge", cl::Hidden,
76  cl::desc("Enable the global merge pass"));
77 
78 namespace llvm {
80 }
81 
83  // Register the target.
88 
90  initializeGlobalISel(Registry);
98  initializeMVEVPTBlockPass(Registry);
102 }
103 
104 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
105  if (TT.isOSBinFormatMachO())
106  return std::make_unique<TargetLoweringObjectFileMachO>();
107  if (TT.isOSWindows())
108  return std::make_unique<TargetLoweringObjectFileCOFF>();
109  return std::make_unique<ARMElfTargetObjectFile>();
110 }
111 
114  const TargetOptions &Options) {
115  StringRef ABIName = Options.MCOptions.getABIName();
116 
117  if (ABIName.empty())
118  ABIName = ARM::computeDefaultTargetABI(TT, CPU);
119 
120  if (ABIName == "aapcs16")
122  else if (ABIName.startswith("aapcs"))
124  else if (ABIName.startswith("apcs"))
126 
127  llvm_unreachable("Unhandled/unknown ABI Name!");
129 }
130 
131 static std::string computeDataLayout(const Triple &TT, StringRef CPU,
132  const TargetOptions &Options,
133  bool isLittle) {
134  auto ABI = computeTargetABI(TT, CPU, Options);
135  std::string Ret;
136 
137  if (isLittle)
138  // Little endian.
139  Ret += "e";
140  else
141  // Big endian.
142  Ret += "E";
143 
145 
146  // Pointers are 32 bits and aligned to 32 bits.
147  Ret += "-p:32:32";
148 
149  // Function pointers are aligned to 8 bits (because the LSB stores the
150  // ARM/Thumb state).
151  Ret += "-Fi8";
152 
153  // ABIs other than APCS have 64 bit integers with natural alignment.
155  Ret += "-i64:64";
156 
157  // We have 64 bits floats. The APCS ABI requires them to be aligned to 32
158  // bits, others to 64 bits. We always try to align to 64 bits.
160  Ret += "-f64:32:64";
161 
162  // We have 128 and 64 bit vectors. The APCS ABI aligns them to 32 bits, others
163  // to 64. We always ty to give them natural alignment.
165  Ret += "-v64:32:64-v128:32:128";
167  Ret += "-v128:64:128";
168 
169  // Try to align aggregates to 32 bits (the default is 64 bits, which has no
170  // particular hardware support on 32-bit ARM).
171  Ret += "-a:0:32";
172 
173  // Integer registers are 32 bits.
174  Ret += "-n32";
175 
176  // The stack is 128 bit aligned on NaCl, 64 bit aligned on AAPCS and 32 bit
177  // aligned everywhere else.
179  Ret += "-S128";
181  Ret += "-S64";
182  else
183  Ret += "-S32";
184 
185  return Ret;
186 }
187 
190  if (!RM.hasValue())
191  // Default relocation model on Darwin is PIC.
193 
194  if (*RM == Reloc::ROPI || *RM == Reloc::RWPI || *RM == Reloc::ROPI_RWPI)
195  assert(TT.isOSBinFormatELF() &&
196  "ROPI/RWPI currently only supported for ELF");
197 
198  // DynamicNoPIC is only used on darwin.
199  if (*RM == Reloc::DynamicNoPIC && !TT.isOSDarwin())
200  return Reloc::Static;
201 
202  return *RM;
203 }
204 
205 /// Create an ARM architecture model.
206 ///
208  StringRef CPU, StringRef FS,
209  const TargetOptions &Options,
212  CodeGenOpt::Level OL, bool isLittle)
213  : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
214  CPU, FS, Options, getEffectiveRelocModel(TT, RM),
215  getEffectiveCodeModel(CM, CodeModel::Small), OL),
216  TargetABI(computeTargetABI(TT, CPU, Options)),
217  TLOF(createTLOF(getTargetTriple())), isLittle(isLittle) {
218 
219  // Default to triple-appropriate float ABI
220  if (Options.FloatABIType == FloatABI::Default) {
221  if (isTargetHardFloat())
222  this->Options.FloatABIType = FloatABI::Hard;
223  else
224  this->Options.FloatABIType = FloatABI::Soft;
225  }
226 
227  // Default to triple-appropriate EABI
228  if (Options.EABIVersion == EABI::Default ||
229  Options.EABIVersion == EABI::Unknown) {
230  // musl is compatible with glibc with regard to EABI version
236  this->Options.EABIVersion = EABI::GNU;
237  else
238  this->Options.EABIVersion = EABI::EABI5;
239  }
240 
241  if (TT.isOSBinFormatMachO()) {
242  this->Options.TrapUnreachable = true;
243  this->Options.NoTrapAfterNoreturn = true;
244  }
245 
246  initAsmInfo();
247 }
248 
250 
251 const ARMSubtarget *
253  Attribute CPUAttr = F.getFnAttribute("target-cpu");
254  Attribute FSAttr = F.getFnAttribute("target-features");
255 
256  std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
257  ? CPUAttr.getValueAsString().str()
258  : TargetCPU;
259  std::string FS = !FSAttr.hasAttribute(Attribute::None)
260  ? FSAttr.getValueAsString().str()
261  : TargetFS;
262 
263  // FIXME: This is related to the code below to reset the target options,
264  // we need to know whether or not the soft float flag is set on the
265  // function before we can generate a subtarget. We also need to use
266  // it as a key for the subtarget since that can be the only difference
267  // between two functions.
268  bool SoftFloat =
269  F.getFnAttribute("use-soft-float").getValueAsString() == "true";
270  // If the soft float attribute is set on the function turn on the soft float
271  // subtarget feature.
272  if (SoftFloat)
273  FS += FS.empty() ? "+soft-float" : ",+soft-float";
274 
275  // Use the optminsize to identify the subtarget, but don't use it in the
276  // feature string.
277  std::string Key = CPU + FS;
278  if (F.hasMinSize())
279  Key += "+minsize";
280 
281  auto &I = SubtargetMap[Key];
282  if (!I) {
283  // This needs to be done before we create a new subtarget since any
284  // creation will depend on the TM and the code generation flags on the
285  // function that reside in TargetOptions.
287  I = std::make_unique<ARMSubtarget>(TargetTriple, CPU, FS, *this, isLittle,
288  F.hasMinSize());
289 
290  if (!I->isThumb() && !I->hasARMOps())
291  F.getContext().emitError("Function '" + F.getName() + "' uses ARM "
292  "instructions, but the target does not support ARM mode execution.");
293  }
294 
295  return I.get();
296 }
297 
300  return TargetTransformInfo(ARMTTIImpl(this, F));
301 }
302 
304  StringRef CPU, StringRef FS,
305  const TargetOptions &Options,
308  CodeGenOpt::Level OL, bool JIT)
309  : ARMBaseTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
310 
312  StringRef CPU, StringRef FS,
313  const TargetOptions &Options,
316  CodeGenOpt::Level OL, bool JIT)
317  : ARMBaseTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
318 
319 namespace {
320 
321 /// ARM Code Generator Pass Configuration Options.
322 class ARMPassConfig : public TargetPassConfig {
323 public:
324  ARMPassConfig(ARMBaseTargetMachine &TM, PassManagerBase &PM)
325  : TargetPassConfig(TM, PM) {}
326 
327  ARMBaseTargetMachine &getARMTargetMachine() const {
328  return getTM<ARMBaseTargetMachine>();
329  }
330 
332  createMachineScheduler(MachineSchedContext *C) const override {
334  // add DAG Mutations here.
335  const ARMSubtarget &ST = C->MF->getSubtarget<ARMSubtarget>();
336  if (ST.hasFusion())
338  return DAG;
339  }
340 
342  createPostMachineScheduler(MachineSchedContext *C) const override {
344  // add DAG Mutations here.
345  const ARMSubtarget &ST = C->MF->getSubtarget<ARMSubtarget>();
346  if (ST.hasFusion())
348  return DAG;
349  }
350 
351  void addIRPasses() override;
352  void addCodeGenPrepare() override;
353  bool addPreISel() override;
354  bool addInstSelector() override;
355  bool addIRTranslator() override;
356  bool addLegalizeMachineIR() override;
357  bool addRegBankSelect() override;
358  bool addGlobalInstructionSelect() override;
359  void addPreRegAlloc() override;
360  void addPreSched2() override;
361  void addPreEmitPass() override;
362 
363  std::unique_ptr<CSEConfigBase> getCSEConfig() const override;
364 };
365 
366 class ARMExecutionDomainFix : public ExecutionDomainFix {
367 public:
368  static char ID;
369  ARMExecutionDomainFix() : ExecutionDomainFix(ID, ARM::DPRRegClass) {}
370  StringRef getPassName() const override {
371  return "ARM Execution Domain Fix";
372  }
373 };
375 
376 } // end anonymous namespace
377 
378 INITIALIZE_PASS_BEGIN(ARMExecutionDomainFix, "arm-execution-domain-fix",
379  "ARM Execution Domain Fix", false, false)
381 INITIALIZE_PASS_END(ARMExecutionDomainFix, "arm-execution-domain-fix",
382  "ARM Execution Domain Fix", false, false)
383 
385  return new ARMPassConfig(*this, PM);
386 }
387 
388 std::unique_ptr<CSEConfigBase> ARMPassConfig::getCSEConfig() const {
389  return getStandardCSEConfigForOpt(TM->getOptLevel());
390 }
391 
392 void ARMPassConfig::addIRPasses() {
393  if (TM->Options.ThreadModel == ThreadModel::Single)
394  addPass(createLowerAtomicPass());
395  else
396  addPass(createAtomicExpandPass());
397 
398  // Cmpxchg instructions are often used with a subsequent comparison to
399  // determine whether it succeeded. We can exploit existing control-flow in
400  // ldrex/strex loops to simplify this, but it needs tidying up.
401  if (TM->getOptLevel() != CodeGenOpt::None && EnableAtomicTidy)
403  1, false, false, true, true, [this](const Function &F) {
404  const auto &ST = this->TM->getSubtarget<ARMSubtarget>(F);
405  return ST.hasAnyDataBarrier() && !ST.isThumb1Only();
406  }));
407 
409 
411 
412  // Run the parallel DSP pass.
414  addPass(createARMParallelDSPPass());
415 
416  // Match interleaved memory accesses to ldN/stN intrinsics.
417  if (TM->getOptLevel() != CodeGenOpt::None)
418  addPass(createInterleavedAccessPass());
419 
420  // Add Control Flow Guard checks.
421  if (TM->getTargetTriple().isOSWindows())
422  addPass(createCFGuardCheckPass());
423 }
424 
425 void ARMPassConfig::addCodeGenPrepare() {
426  if (getOptLevel() != CodeGenOpt::None)
427  addPass(createTypePromotionPass());
429 }
430 
431 bool ARMPassConfig::addPreISel() {
432  if ((TM->getOptLevel() != CodeGenOpt::None &&
434  EnableGlobalMerge == cl::BOU_TRUE) {
435  // FIXME: This is using the thumb1 only constant value for
436  // maximal global offset for merging globals. We may want
437  // to look into using the old value for non-thumb1 code of
438  // 4095 based on the TargetMachine, but this starts to become
439  // tricky when doing code gen per function.
440  bool OnlyOptimizeForSize = (TM->getOptLevel() < CodeGenOpt::Aggressive) &&
441  (EnableGlobalMerge == cl::BOU_UNSET);
442  // Merging of extern globals is enabled by default on non-Mach-O as we
443  // expect it to be generally either beneficial or harmless. On Mach-O it
444  // is disabled as we emit the .subsections_via_symbols directive which
445  // means that merging extern globals is not safe.
446  bool MergeExternalByDefault = !TM->getTargetTriple().isOSBinFormatMachO();
447  addPass(createGlobalMergePass(TM, 127, OnlyOptimizeForSize,
448  MergeExternalByDefault));
449  }
450 
451  if (TM->getOptLevel() != CodeGenOpt::None) {
452  addPass(createHardwareLoopsPass());
453  addPass(createMVETailPredicationPass());
454  }
455 
456  return false;
457 }
458 
459 bool ARMPassConfig::addInstSelector() {
460  addPass(createARMISelDag(getARMTargetMachine(), getOptLevel()));
461  return false;
462 }
463 
464 bool ARMPassConfig::addIRTranslator() {
465  addPass(new IRTranslator());
466  return false;
467 }
468 
469 bool ARMPassConfig::addLegalizeMachineIR() {
470  addPass(new Legalizer());
471  return false;
472 }
473 
474 bool ARMPassConfig::addRegBankSelect() {
475  addPass(new RegBankSelect());
476  return false;
477 }
478 
479 bool ARMPassConfig::addGlobalInstructionSelect() {
480  addPass(new InstructionSelect());
481  return false;
482 }
483 
484 void ARMPassConfig::addPreRegAlloc() {
485  if (getOptLevel() != CodeGenOpt::None) {
486  addPass(createMLxExpansionPass());
487 
489  addPass(createARMLoadStoreOptimizationPass(/* pre-register alloc */ true));
490 
492  addPass(createA15SDOptimizerPass());
493  }
494 }
495 
496 void ARMPassConfig::addPreSched2() {
497  if (getOptLevel() != CodeGenOpt::None) {
500 
501  addPass(new ARMExecutionDomainFix());
502  addPass(createBreakFalseDeps());
503  }
504 
505  // Expand some pseudo instructions into multiple instructions to allow
506  // proper scheduling.
507  addPass(createARMExpandPseudoPass());
508 
509  if (getOptLevel() != CodeGenOpt::None) {
510  // in v8, IfConversion depends on Thumb instruction widths
511  addPass(createThumb2SizeReductionPass([this](const Function &F) {
512  return this->TM->getSubtarget<ARMSubtarget>(F).restrictIT();
513  }));
514 
515  addPass(createIfConverter([](const MachineFunction &MF) {
516  return !MF.getSubtarget<ARMSubtarget>().isThumb1Only();
517  }));
518  }
519  addPass(createMVEVPTBlockPass());
520  addPass(createThumb2ITBlockPass());
521 
522  // Add both scheduling passes to give the subtarget an opportunity to pick
523  // between them.
524  if (getOptLevel() != CodeGenOpt::None) {
525  addPass(&PostMachineSchedulerID);
526  addPass(&PostRASchedulerID);
527  }
528 }
529 
530 void ARMPassConfig::addPreEmitPass() {
532 
533  // Constant island pass work on unbundled instructions.
534  addPass(createUnpackMachineBundles([](const MachineFunction &MF) {
535  return MF.getSubtarget<ARMSubtarget>().isThumb2();
536  }));
537 
538  // Don't optimize barriers at -O0.
539  if (getOptLevel() != CodeGenOpt::None)
541 
542  addPass(createARMConstantIslandPass());
544 
545  // Identify valid longjmp targets for Windows Control Flow Guard.
546  if (TM->getTargetTriple().isOSWindows())
547  addPass(createCFGuardLongjmpPass());
548 }
uint64_t CallInst * C
void initializeMVEGatherScatterLoweringPass(PassRegistry &)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition: Triple.h:482
static ARMBaseTargetMachine::ARMABI computeTargetABI(const Triple &TT, StringRef CPU, const TargetOptions &Options)
FunctionPass * createA15SDOptimizerPass()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value...
FunctionPass * createCFGuardCheckPass()
Insert Control FLow Guard checks on indirect function calls.
Definition: CFGuard.cpp:299
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:239
MCTargetOptions MCOptions
Machine level options.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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:624
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
Definition: TargetMachine.h:84
EABI EABIVersion
EABIVersion - This flag specifies the EABI version.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:277
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:44
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:582
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)
Pass * createMVETailPredicationPass()
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)
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:151
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
This class provides the reaching def analysis.
FunctionPass * createCFGuardLongjmpPass()
Creates CFGuard longjmp target identification pass.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
FunctionPass * createHardwareLoopsPass()
Create Hardware Loop pass.
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:50
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.
FunctionPass * createTypePromotionPass()
Create IR Type Promotion pass.
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
Definition: Attributes.h:72
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:147
Target & getTheARMBETarget()
Target-Independent Code Generator Pass Configuration Options.
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...
Key
PAL metadata keys.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
Target & getTheThumbBETarget()
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.
void initializeMVETailPredicationPass(PassRegistry &)
static std::string computeDataLayout(const Triple &TT, StringRef CPU, const TargetOptions &Options, bool isLittle)
speculative execution
Pass * createMVEGatherScatterLoweringPass()
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:539
FunctionPass * createMVEVPTBlockPass()
createMVEVPTBlock - Returns an instance of the MVE VPT block insertion pass.
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)
std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOpt::Level Level)
Definition: CSEInfo.cpp:71
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:435
void initializeARMExpandPseudoPass(PassRegistry &)
void initializeARMLoadStoreOptPass(PassRegistry &)
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
Definition: Attributes.cpp:235
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:90
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...
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:634
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:223
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:43
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:315
void initializeARMLowOverheadLoopsPass(PassRegistry &)
Pass * createLowerAtomicPass()
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:130
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:85
A ScheduleDAG for scheduling lists of MachineInstr.
bool hasValue() const
Definition: Optional.h:259
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:220
StringRef getName() const
Return a constant reference to the value&#39;s name.
Definition: Value.cpp:215
TargetOptions Options
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
#define I(x, y, z)
Definition: MD5.cpp:58
bool hasMinSize() const
Optimize this function for minimum size (-Oz).
Definition: Function.h:630
const ARMSubtarget * getSubtargetImpl() const =delete
std::string TargetFS
Definition: TargetMachine.h:86
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.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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:333
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:38
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
Definition: ARMSubtarget.h:696
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()
FunctionPass * createARMLowOverheadLoopsPass()
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
Definition: GlobalISel.cpp:18
void initializeMVEVPTBlockPass(PassRegistry &)
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...