LLVM  5.0.0
AArch64TargetMachine.cpp
Go to the documentation of this file.
1 //===-- AArch64TargetMachine.cpp - Define TargetMachine for AArch64 -------===//
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 "AArch64TargetMachine.h"
14 #include "AArch64.h"
15 #include "AArch64MacroFusion.h"
16 #include "AArch64Subtarget.h"
20 #include "llvm/ADT/STLExtras.h"
21 #include "llvm/ADT/Triple.h"
29 #include "llvm/CodeGen/Passes.h"
31 #include "llvm/IR/Attributes.h"
32 #include "llvm/IR/Function.h"
34 #include "llvm/Pass.h"
35 #include "llvm/Support/CodeGen.h"
40 #include "llvm/Transforms/Scalar.h"
41 #include <memory>
42 #include <string>
43 
44 using namespace llvm;
45 
46 static cl::opt<bool> EnableCCMP("aarch64-enable-ccmp",
47  cl::desc("Enable the CCMP formation pass"),
48  cl::init(true), cl::Hidden);
49 
50 static cl::opt<bool>
51  EnableCondBrTuning("aarch64-enable-cond-br-tune",
52  cl::desc("Enable the conditional branch tuning pass"),
53  cl::init(true), cl::Hidden);
54 
55 static cl::opt<bool> EnableMCR("aarch64-enable-mcr",
56  cl::desc("Enable the machine combiner pass"),
57  cl::init(true), cl::Hidden);
58 
59 static cl::opt<bool> EnableStPairSuppress("aarch64-enable-stp-suppress",
60  cl::desc("Suppress STP for AArch64"),
61  cl::init(true), cl::Hidden);
62 
64  "aarch64-enable-simd-scalar",
65  cl::desc("Enable use of AdvSIMD scalar integer instructions"),
66  cl::init(false), cl::Hidden);
67 
68 static cl::opt<bool>
69  EnablePromoteConstant("aarch64-enable-promote-const",
70  cl::desc("Enable the promote constant pass"),
71  cl::init(true), cl::Hidden);
72 
74  "aarch64-enable-collect-loh",
75  cl::desc("Enable the pass that emits the linker optimization hints (LOH)"),
76  cl::init(true), cl::Hidden);
77 
78 static cl::opt<bool>
79  EnableDeadRegisterElimination("aarch64-enable-dead-defs", cl::Hidden,
80  cl::desc("Enable the pass that removes dead"
81  " definitons and replaces stores to"
82  " them with stores to the zero"
83  " register"),
84  cl::init(true));
85 
87  "aarch64-enable-copyelim",
88  cl::desc("Enable the redundant copy elimination pass"), cl::init(true),
89  cl::Hidden);
90 
91 static cl::opt<bool> EnableLoadStoreOpt("aarch64-enable-ldst-opt",
92  cl::desc("Enable the load/store pair"
93  " optimization pass"),
94  cl::init(true), cl::Hidden);
95 
97  "aarch64-enable-atomic-cfg-tidy", cl::Hidden,
98  cl::desc("Run SimplifyCFG after expanding atomic operations"
99  " to make use of cmpxchg flow-based information"),
100  cl::init(true));
101 
102 static cl::opt<bool>
103 EnableEarlyIfConversion("aarch64-enable-early-ifcvt", cl::Hidden,
104  cl::desc("Run early if-conversion"),
105  cl::init(true));
106 
107 static cl::opt<bool>
108  EnableCondOpt("aarch64-enable-condopt",
109  cl::desc("Enable the condition optimizer pass"),
110  cl::init(true), cl::Hidden);
111 
112 static cl::opt<bool>
113 EnableA53Fix835769("aarch64-fix-cortex-a53-835769", cl::Hidden,
114  cl::desc("Work around Cortex-A53 erratum 835769"),
115  cl::init(false));
116 
117 static cl::opt<bool>
118  EnableGEPOpt("aarch64-enable-gep-opt", cl::Hidden,
119  cl::desc("Enable optimizations on complex GEPs"),
120  cl::init(false));
121 
122 static cl::opt<bool>
123  BranchRelaxation("aarch64-enable-branch-relax", cl::Hidden, cl::init(true),
124  cl::desc("Relax out of range conditional branches"));
125 
126 // FIXME: Unify control over GlobalMerge.
128  EnableGlobalMerge("aarch64-enable-global-merge", cl::Hidden,
129  cl::desc("Enable the global merge pass"));
130 
131 static cl::opt<bool>
132  EnableLoopDataPrefetch("aarch64-enable-loop-data-prefetch", cl::Hidden,
133  cl::desc("Enable the loop data prefetch pass"),
134  cl::init(true));
135 
137  "aarch64-enable-global-isel-at-O", cl::Hidden,
138  cl::desc("Enable GlobalISel at or below an opt level (-1 to disable)"),
139  cl::init(-1));
140 
141 static cl::opt<bool> EnableFalkorHWPFFix("aarch64-enable-falkor-hwpf-fix",
142  cl::init(true), cl::Hidden);
143 
144 extern "C" void LLVMInitializeAArch64Target() {
145  // Register the target.
149  auto PR = PassRegistry::getPassRegistry();
167 }
168 
169 //===----------------------------------------------------------------------===//
170 // AArch64 Lowering public interface.
171 //===----------------------------------------------------------------------===//
172 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
173  if (TT.isOSBinFormatMachO())
174  return llvm::make_unique<AArch64_MachoTargetObjectFile>();
175  if (TT.isOSBinFormatCOFF())
176  return llvm::make_unique<AArch64_COFFTargetObjectFile>();
177 
178  return llvm::make_unique<AArch64_ELFTargetObjectFile>();
179 }
180 
181 // Helper function to build a DataLayout string
182 static std::string computeDataLayout(const Triple &TT,
183  const MCTargetOptions &Options,
184  bool LittleEndian) {
185  if (Options.getABIName() == "ilp32")
186  return "e-m:e-p:32:32-i8:8-i16:16-i64:64-S128";
187  if (TT.isOSBinFormatMachO())
188  return "e-m:o-i64:64-i128:128-n32:64-S128";
189  if (TT.isOSBinFormatCOFF())
190  return "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128";
191  if (LittleEndian)
192  return "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
193  return "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128";
194 }
195 
198  // AArch64 Darwin is always PIC.
199  if (TT.isOSDarwin())
200  return Reloc::PIC_;
201  // On ELF platforms the default static relocation model has a smart enough
202  // linker to cope with referencing external symbols defined in a shared
203  // library. Hence DynamicNoPIC doesn't need to be promoted to PIC.
204  if (!RM.hasValue() || *RM == Reloc::DynamicNoPIC)
205  return Reloc::Static;
206  return *RM;
207 }
208 
209 /// Create an AArch64 architecture model.
210 ///
212  const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
213  const TargetOptions &Options, Optional<Reloc::Model> RM,
214  CodeModel::Model CM, CodeGenOpt::Level OL, bool LittleEndian)
215  // This nested ternary is horrible, but DL needs to be properly
216  // initialized before TLInfo is constructed.
217  : LLVMTargetMachine(T, computeDataLayout(TT, Options.MCOptions,
218  LittleEndian),
219  TT, CPU, FS, Options,
220  getEffectiveRelocModel(TT, RM), CM, OL),
221  TLOF(createTLOF(getTargetTriple())),
222  isLittle(LittleEndian) {
223  initAsmInfo();
224 }
225 
227 
228 const AArch64Subtarget *
230  Attribute CPUAttr = F.getFnAttribute("target-cpu");
231  Attribute FSAttr = F.getFnAttribute("target-features");
232 
233  std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
234  ? CPUAttr.getValueAsString().str()
235  : TargetCPU;
236  std::string FS = !FSAttr.hasAttribute(Attribute::None)
237  ? FSAttr.getValueAsString().str()
238  : TargetFS;
239 
240  auto &I = SubtargetMap[CPU + FS];
241  if (!I) {
242  // This needs to be done before we create a new subtarget since any
243  // creation will depend on the TM and the code generation flags on the
244  // function that reside in TargetOptions.
246  I = llvm::make_unique<AArch64Subtarget>(TargetTriple, CPU, FS, *this,
247  isLittle);
248  }
249  return I.get();
250 }
251 
252 void AArch64leTargetMachine::anchor() { }
253 
255  const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
256  const TargetOptions &Options, Optional<Reloc::Model> RM,
258  : AArch64TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
259 
260 void AArch64beTargetMachine::anchor() { }
261 
263  const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
264  const TargetOptions &Options, Optional<Reloc::Model> RM,
266  : AArch64TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
267 
268 namespace {
269 
270 /// AArch64 Code Generator Pass Configuration Options.
271 class AArch64PassConfig : public TargetPassConfig {
272 public:
273  AArch64PassConfig(AArch64TargetMachine &TM, PassManagerBase &PM)
274  : TargetPassConfig(TM, PM) {
275  if (TM.getOptLevel() != CodeGenOpt::None)
276  substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
277  }
278 
279  AArch64TargetMachine &getAArch64TargetMachine() const {
280  return getTM<AArch64TargetMachine>();
281  }
282 
284  createMachineScheduler(MachineSchedContext *C) const override {
287  DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI));
288  DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
289  if (ST.hasFusion())
290  DAG->addMutation(createAArch64MacroFusionDAGMutation());
291  return DAG;
292  }
293 
295  createPostMachineScheduler(MachineSchedContext *C) const override {
297  if (ST.hasFusion()) {
298  // Run the Macro Fusion after RA again since literals are expanded from
299  // pseudos then (v. addPreSched2()).
302  return DAG;
303  }
304 
305  return nullptr;
306  }
307 
308  void addIRPasses() override;
309  bool addPreISel() override;
310  bool addInstSelector() override;
311 #ifdef LLVM_BUILD_GLOBAL_ISEL
312  bool addIRTranslator() override;
313  bool addLegalizeMachineIR() override;
314  bool addRegBankSelect() override;
315  void addPreGlobalInstructionSelect() override;
316  bool addGlobalInstructionSelect() override;
317 #endif
318  bool addILPOpts() override;
319  void addPreRegAlloc() override;
320  void addPostRegAlloc() override;
321  void addPreSched2() override;
322  void addPreEmitPass() override;
323 
324  bool isGlobalISelEnabled() const override;
325 };
326 
327 } // end anonymous namespace
328 
330  return TargetIRAnalysis([this](const Function &F) {
331  return TargetTransformInfo(AArch64TTIImpl(this, F));
332  });
333 }
334 
336  return new AArch64PassConfig(*this, PM);
337 }
338 
339 void AArch64PassConfig::addIRPasses() {
340  // Always expand atomic operations, we don't deal with atomicrmw or cmpxchg
341  // ourselves.
342  addPass(createAtomicExpandPass());
343 
344  // Cmpxchg instructions are often used with a subsequent comparison to
345  // determine whether it succeeded. We can exploit existing control-flow in
346  // ldrex/strex loops to simplify this, but it needs tidying up.
348  addPass(createCFGSimplificationPass());
349 
350  // Run LoopDataPrefetch
351  //
352  // Run this before LSR to remove the multiplies involved in computing the
353  // pointer values N iterations ahead.
354  if (TM->getOptLevel() != CodeGenOpt::None) {
356  addPass(createLoopDataPrefetchPass());
359  }
360 
362 
363  // Match interleaved memory accesses to ldN/stN intrinsics.
364  if (TM->getOptLevel() != CodeGenOpt::None)
365  addPass(createInterleavedAccessPass());
366 
368  // Call SeparateConstOffsetFromGEP pass to extract constants within indices
369  // and lower a GEP with multiple indices to either arithmetic operations or
370  // multiple GEPs with single index.
371  addPass(createSeparateConstOffsetFromGEPPass(TM, true));
372  // Call EarlyCSE pass to find and remove subexpressions in the lowered
373  // result.
374  addPass(createEarlyCSEPass());
375  // Do loop invariant code motion in case part of the lowered result is
376  // invariant.
377  addPass(createLICMPass());
378  }
379 }
380 
381 // Pass Pipeline Configuration
382 bool AArch64PassConfig::addPreISel() {
383  // Run promote constant before global merge, so that the promoted constants
384  // get a chance to be merged
387  // FIXME: On AArch64, this depends on the type.
388  // Basically, the addressable offsets are up to 4095 * Ty.getSizeInBytes().
389  // and the offset has to be a multiple of the related size in bytes.
390  if ((TM->getOptLevel() != CodeGenOpt::None &&
392  EnableGlobalMerge == cl::BOU_TRUE) {
393  bool OnlyOptimizeForSize = (TM->getOptLevel() < CodeGenOpt::Aggressive) &&
394  (EnableGlobalMerge == cl::BOU_UNSET);
395  addPass(createGlobalMergePass(TM, 4095, OnlyOptimizeForSize));
396  }
397 
398  return false;
399 }
400 
401 bool AArch64PassConfig::addInstSelector() {
402  addPass(createAArch64ISelDag(getAArch64TargetMachine(), getOptLevel()));
403 
404  // For ELF, cleanup any local-dynamic TLS accesses (i.e. combine as many
405  // references to _TLS_MODULE_BASE_ as possible.
406  if (TM->getTargetTriple().isOSBinFormatELF() &&
407  getOptLevel() != CodeGenOpt::None)
409 
410  return false;
411 }
412 
413 #ifdef LLVM_BUILD_GLOBAL_ISEL
414 bool AArch64PassConfig::addIRTranslator() {
415  addPass(new IRTranslator());
416  return false;
417 }
418 
419 bool AArch64PassConfig::addLegalizeMachineIR() {
420  addPass(new Legalizer());
421  return false;
422 }
423 
424 bool AArch64PassConfig::addRegBankSelect() {
425  addPass(new RegBankSelect());
426  return false;
427 }
428 
429 void AArch64PassConfig::addPreGlobalInstructionSelect() {
430  // Workaround the deficiency of the fast register allocator.
431  if (TM->getOptLevel() == CodeGenOpt::None)
432  addPass(new Localizer());
433 }
434 
435 bool AArch64PassConfig::addGlobalInstructionSelect() {
436  addPass(new InstructionSelect());
437  return false;
438 }
439 #endif
440 
441 bool AArch64PassConfig::isGlobalISelEnabled() const {
442  return TM->getOptLevel() <= EnableGlobalISelAtO;
443 }
444 
445 bool AArch64PassConfig::addILPOpts() {
446  if (EnableCondOpt)
448  if (EnableCCMP)
450  if (EnableMCR)
451  addPass(&MachineCombinerID);
452  if (EnableCondBrTuning)
453  addPass(createAArch64CondBrTuning());
455  addPass(&EarlyIfConverterID);
459  return true;
460 }
461 
462 void AArch64PassConfig::addPreRegAlloc() {
463  // Change dead register definitions to refer to the zero register.
466 
467  // Use AdvSIMD scalar instructions whenever profitable.
469  addPass(createAArch64AdvSIMDScalar());
470  // The AdvSIMD pass may produce copies that can be rewritten to
471  // be register coaleascer friendly.
472  addPass(&PeepholeOptimizerID);
473  }
474 }
475 
476 void AArch64PassConfig::addPostRegAlloc() {
477  // Remove redundant copy instructions.
480 
481  if (TM->getOptLevel() != CodeGenOpt::None && usingDefaultRegAlloc())
482  // Improve performance for some FP/SIMD code for A57.
484 }
485 
486 void AArch64PassConfig::addPreSched2() {
487  // Expand some pseudo instructions to allow proper scheduling.
489  // Use load/store pair instructions when possible.
490  if (TM->getOptLevel() != CodeGenOpt::None) {
491  if (EnableLoadStoreOpt)
494  addPass(createFalkorHWPFFixPass());
495  }
496 }
497 
498 void AArch64PassConfig::addPreEmitPass() {
499  if (EnableA53Fix835769)
500  addPass(createAArch64A53Fix835769());
501  // Relax conditional branch instructions if they're otherwise out of
502  // range of their destination.
503  if (BranchRelaxation)
504  addPass(&BranchRelaxationPassID);
505 
508  addPass(createAArch64CollectLOHPass());
509 }
char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
Target & getTheAArch64beTarget()
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition: Triple.h:587
void initializeAArch64A53Fix835769Pass(PassRegistry &)
bool hasValue() const
Definition: Optional.h:133
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
FunctionPass * createFalkorMarkStridedAccessesPass()
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
Definition: TargetMachine.h:75
void initializeAArch64LoadStoreOptPass(PassRegistry &)
Target & getTheAArch64leTarget()
This pass implements the localization mechanism described at the top of this file.
Definition: Localizer.h:39
char & EarlyIfConverterID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions...
Analysis pass providing the TargetTransformInfo.
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...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
Definition: Function.h:262
FunctionPass * createAArch64ConditionalCompares()
void initializeAArch64RedundantCopyEliminationPass(PassRegistry &)
AArch64TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool IsLittleEndian)
Create an AArch64 architecture model.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
ModulePass * createAArch64PromoteConstantPass()
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
Definition: Attributes.cpp:202
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
FunctionPass * createLoopDataPrefetchPass()
const Triple & getTargetTriple() const
FunctionPass * createAArch64CollectLOHPass()
static cl::opt< bool > EnableEarlyIfConversion("aarch64-enable-early-ifcvt", cl::Hidden, cl::desc("Run early if-conversion"), cl::init(true))
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
FunctionPass * createAArch64VectorByElementOptPass()
createAArch64VectorByElementOptPass - returns an instance of the vector by element optimization pass...
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))
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(-1))
void initializeLDTLSCleanupPass(PassRegistry &)
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.
Definition: Attributes.h:72
Target & getTheARM64Target()
void initializeAArch64CollectLOHPass(PassRegistry &)
Target-Independent Code Generator Pass Configuration Options.
zlib-gnu style compression
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
#define F(x, y, z)
Definition: MD5.cpp:55
FunctionPass * createAArch64A57FPLoadBalancing()
static cl::opt< bool > EnableCondBrTuning("aarch64-enable-cond-br-tune", cl::desc("Enable the conditional branch tuning pass"), cl::init(true), cl::Hidden)
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)
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))
AArch64beTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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...
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
void initializeAArch64A57FPLoadBalancingPass(PassRegistry &)
Function Alias Analysis false
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:401
void initializeAArch64PromoteConstantPass(PassRegistry &)
FunctionPass * createSeparateConstOffsetFromGEPPass(const TargetMachine *TM=nullptr, bool LowerGEP=false)
void initializeAArch64ExpandPseudoPass(PassRegistry &)
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
AArch64leTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
void LLVMInitializeAArch64Target()
void initializeAArch64VectorByElementOptPass(PassRegistry &)
FunctionPass * createInterleavedAccessPass()
InterleavedAccess Pass - This pass identifies and matches interleaved memory accesses to target speci...
Pass * createLICMPass()
Definition: LICM.cpp:223
FunctionPass * createAArch64AdvSIMDScalar()
const AArch64Subtarget * getSubtargetImpl() const =delete
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...
std::unique_ptr< ScheduleDAGMutation > createAArch64MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAArch64MacroFusionDAGMutation()); to AArch64PassConf...
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition: Triple.h:582
std::unique_ptr< ScheduleDAGMutation > createStoreClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
FunctionPass * createAArch64RedundantCopyEliminationPass()
This file a TargetTransformInfo::Concept conforming object specific to the AArch64 target machine...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:228
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
static cl::opt< bool > EnableRedundantCopyElimination("aarch64-enable-copyelim", cl::desc("Enable the redundant copy elimination pass"), cl::init(true), cl::Hidden)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
Definition: Triple.h:466
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))
std::unique_ptr< ScheduleDAGMutation > createLoadClusterDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
static cl::opt< bool > EnableGEPOpt("aarch64-enable-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(false))
FunctionPass * createAArch64ExpandPseudoPass()
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 &)
FunctionPass * createAArch64A53Fix835769()
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...
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
Target - Wrapper for Target specific information.
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()
std::string TargetCPU
Definition: TargetMachine.h:76
TargetIRAnalysis getTargetIRAnalysis() override
Get the TargetIRAnalysis for this target.
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)
Basic Alias true
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))
void initializeAArch64ConditionOptimizerPass(PassRegistry &)
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:577
char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
StringMap< std::unique_ptr< AArch64Subtarget > > SubtargetMap
#define C
Definition: LargeTest.cpp:25
FunctionPass * createAArch64StorePairSuppressPass()
FunctionPass * createAArch64CondBrTuning()
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
#define I(x, y, z)
Definition: MD5.cpp:58
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
FunctionPass * createFalkorHWPFFixPass()
static cl::opt< bool > EnableCCMP("aarch64-enable-ccmp", cl::desc("Enable the CCMP formation pass"), cl::init(true), cl::Hidden)
void initializeAArch64ConditionalComparesPass(PassRegistry &)
std::string TargetFS
Definition: TargetMachine.h:77
static cl::opt< bool > EnableLoadStoreOpt("aarch64-enable-ldst-opt", cl::desc("Enable the load/store pair"" optimization pass"), cl::init(true), cl::Hidden)
StringRef getValueAsString() const
Return the attribute's value as a string.
Definition: Attributes.cpp:195
This file declares the IRTranslator pass.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry &)
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1086
FunctionPass * createAArch64DeadRegisterDefinitions()
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
This pass exposes codegen information to IR-level passes.
static cl::opt< bool > BranchRelaxation("aarch64-enable-branch-relax", cl::Hidden, cl::init(true), cl::desc("Relax out of range conditional branches"))
FunctionPass * createAtomicExpandPass()
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
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.
Definition: GlobalISel.cpp:21
void initializeAArch64AdvSIMDScalarPass(PassRegistry &)
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
void initializeAArch64StorePairSuppressPass(PassRegistry &)