LLVM  14.0.0git
HexagonTargetMachine.cpp
Go to the documentation of this file.
1 //===-- HexagonTargetMachine.cpp - Define TargetMachine for Hexagon -------===//
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 // Implements the info about Hexagon target spec.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "HexagonTargetMachine.h"
14 #include "Hexagon.h"
15 #include "HexagonISelLowering.h"
22 #include "llvm/CodeGen/Passes.h"
26 #include "llvm/IR/Module.h"
27 #include "llvm/MC/TargetRegistry.h"
31 #include "llvm/Transforms/Scalar.h"
32 
33 using namespace llvm;
34 
36  cl::init(true), cl::desc("Enable Hexagon constant-extender optimization"));
37 
39  cl::init(true), cl::desc("Enable RDF-based optimizations"));
40 
41 static cl::opt<bool> DisableHardwareLoops("disable-hexagon-hwloops",
42  cl::Hidden, cl::desc("Disable Hardware Loops for Hexagon target"));
43 
44 static cl::opt<bool> DisableAModeOpt("disable-hexagon-amodeopt",
46  cl::desc("Disable Hexagon Addressing Mode Optimization"));
47 
48 static cl::opt<bool> DisableHexagonCFGOpt("disable-hexagon-cfgopt",
50  cl::desc("Disable Hexagon CFG Optimization"));
51 
52 static cl::opt<bool> DisableHCP("disable-hcp", cl::init(false), cl::Hidden,
53  cl::ZeroOrMore, cl::desc("Disable Hexagon constant propagation"));
54 
55 static cl::opt<bool> DisableStoreWidening("disable-store-widen",
56  cl::Hidden, cl::init(false), cl::desc("Disable store widening"));
57 
58 static cl::opt<bool> EnableExpandCondsets("hexagon-expand-condsets",
60  cl::desc("Early expansion of MUX"));
61 
62 static cl::opt<bool> EnableEarlyIf("hexagon-eif", cl::init(true), cl::Hidden,
63  cl::ZeroOrMore, cl::desc("Enable early if-conversion"));
64 
65 static cl::opt<bool> EnableGenInsert("hexagon-insert", cl::init(true),
66  cl::Hidden, cl::desc("Generate \"insert\" instructions"));
67 
68 static cl::opt<bool> EnableCommGEP("hexagon-commgep", cl::init(true),
69  cl::Hidden, cl::ZeroOrMore, cl::desc("Enable commoning of GEP instructions"));
70 
71 static cl::opt<bool> EnableGenExtract("hexagon-extract", cl::init(true),
72  cl::Hidden, cl::desc("Generate \"extract\" instructions"));
73 
74 static cl::opt<bool> EnableGenMux("hexagon-mux", cl::init(true), cl::Hidden,
75  cl::desc("Enable converting conditional transfers into MUX instructions"));
76 
77 static cl::opt<bool> EnableGenPred("hexagon-gen-pred", cl::init(true),
78  cl::Hidden, cl::desc("Enable conversion of arithmetic operations to "
79  "predicate instructions"));
80 
81 static cl::opt<bool> EnableLoopPrefetch("hexagon-loop-prefetch",
83  cl::desc("Enable loop data prefetch on Hexagon"));
84 
85 static cl::opt<bool> DisableHSDR("disable-hsdr", cl::init(false), cl::Hidden,
86  cl::desc("Disable splitting double registers"));
87 
88 static cl::opt<bool> EnableBitSimplify("hexagon-bit", cl::init(true),
89  cl::Hidden, cl::desc("Bit simplification"));
90 
91 static cl::opt<bool> EnableLoopResched("hexagon-loop-resched", cl::init(true),
92  cl::Hidden, cl::desc("Loop rescheduling"));
93 
94 static cl::opt<bool> HexagonNoOpt("hexagon-noopt", cl::init(false),
95  cl::Hidden, cl::desc("Disable backend optimizations"));
96 
97 static cl::opt<bool> EnableVectorPrint("enable-hexagon-vector-print",
99  cl::desc("Enable Hexagon Vector print instr pass"));
100 
101 static cl::opt<bool> EnableVExtractOpt("hexagon-opt-vextract", cl::Hidden,
102  cl::ZeroOrMore, cl::init(true), cl::desc("Enable vextract optimization"));
103 
104 static cl::opt<bool> EnableVectorCombine("hexagon-vector-combine", cl::Hidden,
105  cl::ZeroOrMore, cl::init(true), cl::desc("Enable HVX vector combining"));
106 
107 static cl::opt<bool> EnableInitialCFGCleanup("hexagon-initial-cfg-cleanup",
109  cl::desc("Simplify the CFG after atomic expansion pass"));
110 
111 static cl::opt<bool> EnableInstSimplify("hexagon-instsimplify", cl::Hidden,
112  cl::ZeroOrMore, cl::init(true),
113  cl::desc("Enable instsimplify"));
114 
115 /// HexagonTargetMachineModule - Note that this is used on hosts that
116 /// cannot link in a library unless there are references into the
117 /// library. In particular, it seems that it is not possible to get
118 /// things to work on Win32 without this. Though it is unused, do not
119 /// remove it.
122 
125  C, std::make_unique<HexagonConvergingVLIWScheduler>());
126  DAG->addMutation(std::make_unique<HexagonSubtarget::UsrOverflowMutation>());
127  DAG->addMutation(std::make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
128  DAG->addMutation(std::make_unique<HexagonSubtarget::CallMutation>());
130  return DAG;
131 }
132 
134 SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler",
136 
137 namespace llvm {
138  extern char &HexagonExpandCondsetsID;
158 
175  CodeGenOpt::Level OptLevel);
180  FunctionPass *createHexagonPacketizer(bool Minimal);
189 } // end namespace llvm;
190 
192  return RM.getValueOr(Reloc::Static);
193 }
194 
196  // Register the target.
198 
216 }
217 
219  StringRef CPU, StringRef FS,
220  const TargetOptions &Options,
223  CodeGenOpt::Level OL, bool JIT)
224  // Specify the vector alignment explicitly. For v512x1, the calculated
225  // alignment would be 512*alignment(i1), which is 512 bytes, instead of
226  // the required minimum of 64 bytes.
228  T,
229  "e-m:e-p:32:32:32-a:0-n16:32-"
230  "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-"
231  "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048",
232  TT, CPU, FS, Options, getEffectiveRelocModel(RM),
234  (HexagonNoOpt ? CodeGenOpt::None : OL)),
235  TLOF(std::make_unique<HexagonTargetObjectFile>()) {
237  initAsmInfo();
238 }
239 
240 const HexagonSubtarget *
242  AttributeList FnAttrs = F.getAttributes();
243  Attribute CPUAttr =
244  FnAttrs.getFnAttr("target-cpu");
245  Attribute FSAttr =
246  FnAttrs.getFnAttr("target-features");
247 
248  std::string CPU =
249  CPUAttr.isValid() ? CPUAttr.getValueAsString().str() : TargetCPU;
250  std::string FS =
251  FSAttr.isValid() ? FSAttr.getValueAsString().str() : TargetFS;
252  // Append the preexisting target features last, so that +mattr overrides
253  // the "unsafe-fp-math" function attribute.
254  // Creating a separate target feature is not strictly necessary, it only
255  // exists to make "unsafe-fp-math" force creating a new subtarget.
256 
257  if (F.getFnAttribute("unsafe-fp-math").getValueAsBool())
258  FS = FS.empty() ? "+unsafe-fp" : "+unsafe-fp," + FS;
259 
260  auto &I = SubtargetMap[CPU + FS];
261  if (!I) {
262  // This needs to be done before we create a new subtarget since any
263  // creation will depend on the TM and the code generation flags on the
264  // function that reside in TargetOptions.
266  I = std::make_unique<HexagonSubtarget>(TargetTriple, CPU, FS, *this);
267  }
268  return I.get();
269 }
270 
272  PMB.addExtension(
274  [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
276  });
277  PMB.addExtension(
279  [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
281  });
282 }
283 
288  });
292  });
293 }
294 
297  return TargetTransformInfo(HexagonTTIImpl(this, F));
298 }
299 
300 
302 
303 namespace {
304 /// Hexagon Code Generator Pass Configuration Options.
305 class HexagonPassConfig : public TargetPassConfig {
306 public:
307  HexagonPassConfig(HexagonTargetMachine &TM, PassManagerBase &PM)
308  : TargetPassConfig(TM, PM) {}
309 
310  HexagonTargetMachine &getHexagonTargetMachine() const {
311  return getTM<HexagonTargetMachine>();
312  }
313 
315  createMachineScheduler(MachineSchedContext *C) const override {
316  return createVLIWMachineSched(C);
317  }
318 
319  void addIRPasses() override;
320  bool addInstSelector() override;
321  void addPreRegAlloc() override;
322  void addPostRegAlloc() override;
323  void addPreSched2() override;
324  void addPreEmitPass() override;
325 };
326 } // namespace
327 
329  return new HexagonPassConfig(*this, PM);
330 }
331 
332 void HexagonPassConfig::addIRPasses() {
334  bool NoOpt = (getOptLevel() == CodeGenOpt::None);
335 
336  if (!NoOpt) {
337  if (EnableInstSimplify)
338  addPass(createInstSimplifyLegacyPass());
340  }
341 
342  addPass(createAtomicExpandPass());
343 
344  if (!NoOpt) {
347  .forwardSwitchCondToPhi(true)
348  .convertSwitchToLookupTable(true)
349  .needCanonicalLoops(false)
350  .hoistCommonInsts(true)
351  .sinkCommonInsts(true)));
352  if (EnableLoopPrefetch)
353  addPass(createLoopDataPrefetchPass());
356  if (EnableCommGEP)
357  addPass(createHexagonCommonGEP());
358  // Replace certain combinations of shifts and ands with extracts.
359  if (EnableGenExtract)
360  addPass(createHexagonGenExtract());
361  }
362 }
363 
364 bool HexagonPassConfig::addInstSelector() {
365  HexagonTargetMachine &TM = getHexagonTargetMachine();
366  bool NoOpt = (getOptLevel() == CodeGenOpt::None);
367 
368  if (!NoOpt)
370 
371  addPass(createHexagonISelDag(TM, getOptLevel()));
372 
373  if (!NoOpt) {
374  if (EnableVExtractOpt)
375  addPass(createHexagonVExtract());
376  // Create logical operations on predicate registers.
377  if (EnableGenPred)
378  addPass(createHexagonGenPredicate());
379  // Rotate loops to expose bit-simplification opportunities.
380  if (EnableLoopResched)
382  // Split double registers.
383  if (!DisableHSDR)
384  addPass(createHexagonSplitDoubleRegs());
385  // Bit simplification.
386  if (EnableBitSimplify)
387  addPass(createHexagonBitSimplify());
388  addPass(createHexagonPeephole());
389  // Constant propagation.
390  if (!DisableHCP) {
393  }
394  if (EnableGenInsert)
395  addPass(createHexagonGenInsert());
396  if (EnableEarlyIf)
398  }
399 
400  return false;
401 }
402 
403 void HexagonPassConfig::addPreRegAlloc() {
404  if (getOptLevel() != CodeGenOpt::None) {
405  if (EnableCExtOpt)
406  addPass(createHexagonConstExtenders());
410  addPass(createHexagonStoreWidening());
412  addPass(createHexagonHardwareLoops());
413  }
414  if (TM->getOptLevel() >= CodeGenOpt::Default)
415  addPass(&MachinePipelinerID);
416 }
417 
418 void HexagonPassConfig::addPostRegAlloc() {
419  if (getOptLevel() != CodeGenOpt::None) {
420  if (EnableRDFOpt)
421  addPass(createHexagonRDFOpt());
423  addPass(createHexagonCFGOptimizer());
424  if (!DisableAModeOpt)
425  addPass(createHexagonOptAddrMode());
426  }
427 }
428 
429 void HexagonPassConfig::addPreSched2() {
430  addPass(createHexagonCopyToCombine());
431  if (getOptLevel() != CodeGenOpt::None)
432  addPass(&IfConverterID);
434 }
435 
436 void HexagonPassConfig::addPreEmitPass() {
437  bool NoOpt = (getOptLevel() == CodeGenOpt::None);
438 
439  if (!NoOpt)
440  addPass(createHexagonNewValueJump());
441 
443 
444  if (!NoOpt) {
446  addPass(createHexagonFixupHwLoops());
447  // Generate MUX from pairs of conditional transfers.
448  if (EnableGenMux)
449  addPass(createHexagonGenMux());
450  }
451 
452  // Packetization is mandatory: it handles gather/scatter at all opt levels.
453  addPass(createHexagonPacketizer(NoOpt));
454 
455  if (EnableVectorPrint)
456  addPass(createHexagonVectorPrint());
457 
458  // Add CFI instructions if necessary.
460 }
HexagonTargetInfo.h
EnableLoopResched
static cl::opt< bool > EnableLoopResched("hexagon-loop-resched", cl::init(true), cl::Hidden, cl::desc("Loop rescheduling"))
llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >
Definition: LoopPassManager.h:70
DisableStoreWidening
static cl::opt< bool > DisableStoreWidening("disable-store-widen", cl::Hidden, cl::init(false), cl::desc("Disable store widening"))
EnableRDFOpt
static cl::opt< bool > EnableRDFOpt("rdf-opt", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable RDF-based optimizations"))
llvm::createHexagonBranchRelaxation
FunctionPass * createHexagonBranchRelaxation()
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
PassBuilder.h
llvm::Attribute::isValid
bool isValid() const
Return true if the attribute is any kind of attribute.
Definition: Attributes.h:168
llvm::createHexagonLoopIdiomPass
Pass * createHexagonLoopIdiomPass()
Definition: HexagonLoopIdiomRecognition.cpp:2461
llvm::createHexagonNewValueJump
FunctionPass * createHexagonNewValueJump()
Definition: HexagonNewValueJump.cpp:721
llvm::createHexagonCallFrameInformation
FunctionPass * createHexagonCallFrameInformation()
llvm::X86AS::FS
@ FS
Definition: X86.h:188
DisableHCP
static cl::opt< bool > DisableHCP("disable-hcp", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Disable Hexagon constant propagation"))
llvm::createHexagonVectorLoopCarriedReuseLegacyPass
Pass * createHexagonVectorLoopCarriedReuseLegacyPass()
Definition: HexagonVectorLoopCarriedReuse.cpp:665
llvm::TargetOptions
Definition: TargetOptions.h:124
Scalar.h
EnableInstSimplify
static cl::opt< bool > EnableInstSimplify("hexagon-instsimplify", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable instsimplify"))
T
llvm::Function
Definition: Function.h:62
llvm::Attribute
Definition: Attributes.h:52
EnableGenPred
static cl::opt< bool > EnableGenPred("hexagon-gen-pred", cl::init(true), cl::Hidden, cl::desc("Enable conversion of arithmetic operations to " "predicate instructions"))
llvm::createCFGSimplificationPass
FunctionPass * createCFGSimplificationPass(SimplifyCFGOptions Options=SimplifyCFGOptions(), std::function< bool(const Function &)> Ftor=nullptr)
Definition: SimplifyCFGPass.cpp:426
llvm::MachinePipelinerID
char & MachinePipelinerID
This pass performs software pipelining on machine instructions.
Definition: MachinePipeliner.cpp:184
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::MachineSchedRegistry
MachineSchedRegistry provides a selection of available machine instruction schedulers.
Definition: MachineScheduler.h:141
llvm::createHexagonVectorCombineLegacyPass
FunctionPass * createHexagonVectorCombineLegacyPass()
Definition: HexagonVectorCombine.cpp:1529
llvm::initializeHexagonPacketizerPass
void initializeHexagonPacketizerPass(PassRegistry &)
llvm::HexagonTargetMachine
Definition: HexagonTargetMachine.h:25
llvm::createHexagonLoopRescheduling
FunctionPass * createHexagonLoopRescheduling()
Definition: HexagonBitSimplify.cpp:3369
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:168
llvm::initializeHexagonVectorCombineLegacyPass
void initializeHexagonVectorCombineLegacyPass(PassRegistry &)
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::HexagonTargetMachine::createPassConfig
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Definition: HexagonTargetMachine.cpp:328
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:143
HexagonTargetTransformInfo.h
llvm::initializeHexagonOptAddrModePass
void initializeHexagonOptAddrModePass(PassRegistry &)
Module.h
llvm::AttributeList
Definition: Attributes.h:403
llvm::Optional< Reloc::Model >
EnableCExtOpt
static cl::opt< bool > EnableCExtOpt("hexagon-cext", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable Hexagon constant-extender optimization"))
llvm::VLIWMachineScheduler
Extend the standard ScheduleDAGMILive to provide more context and override the top-level schedule() d...
Definition: VLIWMachineScheduler.h:69
HexagonTargetMachineModule
int HexagonTargetMachineModule
HexagonTargetMachineModule - Note that this is used on hosts that cannot link in a library unless the...
Definition: HexagonTargetMachine.cpp:120
llvm::createHexagonCFGOptimizer
FunctionPass * createHexagonCFGOptimizer()
llvm::createHexagonGenExtract
FunctionPass * createHexagonGenExtract()
Definition: HexagonGenExtract.cpp:268
llvm::HexagonTargetObjectFile
Definition: HexagonTargetObjectFile.h:18
HexagonTargetMachine.h
EnableLoopPrefetch
static cl::opt< bool > EnableLoopPrefetch("hexagon-loop-prefetch", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable loop data prefetch on Hexagon"))
llvm::createHexagonStoreWidening
FunctionPass * createHexagonStoreWidening()
Definition: HexagonStoreWidening.cpp:604
LegacyPassManager.h
PassManagerBuilder.h
llvm::initializeHexagonEarlyIfConversionPass
void initializeHexagonEarlyIfConversionPass(PassRegistry &Registry)
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::PassManagerBuilder::EP_LoopOptimizerEnd
@ EP_LoopOptimizerEnd
EP_LoopOptimizerEnd - This extension point allows adding loop passes to the end of the loop optimizer...
Definition: PassManagerBuilder.h:79
llvm::Reloc::Model
Model
Definition: CodeGen.h:22
llvm::initializeHexagonVectorLoopCarriedReuseLegacyPassPass
void initializeHexagonVectorLoopCarriedReuseLegacyPassPass(PassRegistry &)
CommandLine.h
llvm::createHexagonSplitDoubleRegs
FunctionPass * createHexagonSplitDoubleRegs()
Definition: HexagonSplitDouble.cpp:1232
llvm::MSP430Attrs::CodeModel
CodeModel
Definition: MSP430Attributes.h:37
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
llvm::createHexagonEarlyIfConversion
FunctionPass * createHexagonEarlyIfConversion()
Definition: HexagonEarlyIfConv.cpp:1077
llvm::createHexagonRDFOpt
FunctionPass * createHexagonRDFOpt()
Definition: HexagonRDFOpt.cpp:339
EnableVectorPrint
static cl::opt< bool > EnableVectorPrint("enable-hexagon-vector-print", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable Hexagon Vector print instr pass"))
llvm::createHexagonGenMux
FunctionPass * createHexagonGenMux()
Definition: HexagonGenMux.cpp:390
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
createVLIWMachineSched
static ScheduleDAGInstrs * createVLIWMachineSched(MachineSchedContext *C)
Definition: HexagonTargetMachine.cpp:123
llvm::PassBuilder
This class provides access to building LLVM's passes.
Definition: PassBuilder.h:94
llvm::createHexagonVExtract
FunctionPass * createHexagonVExtract()
Definition: HexagonVExtract.cpp:193
EnableCommGEP
static cl::opt< bool > EnableCommGEP("hexagon-commgep", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable commoning of GEP instructions"))
llvm::createCopyConstrainDAGMutation
std::unique_ptr< ScheduleDAGMutation > createCopyConstrainDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
Definition: MachineScheduler.cpp:1797
LLVMInitializeHexagonTarget
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonTarget()
Definition: HexagonTargetMachine.cpp:195
llvm::RegisterCoalescerID
char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
Definition: RegisterCoalescer.cpp:410
EnableInitialCFGCleanup
static cl::opt< bool > EnableInitialCFGCleanup("hexagon-initial-cfg-cleanup", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Simplify the CFG after atomic expansion pass"))
llvm::CodeModel::Small
@ Small
Definition: CodeGen.h:28
llvm::createAtomicExpandPass
FunctionPass * createAtomicExpandPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
llvm::initializeHexagonExpandCondsetsPass
void initializeHexagonExpandCondsetsPass(PassRegistry &)
llvm::RegisterTargetMachine
RegisterTargetMachine - Helper template for registering a target machine implementation,...
Definition: TargetRegistry.h:1275
llvm::ScheduleDAGMI::addMutation
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
Definition: MachineScheduler.h:323
llvm::PassRegistry
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:38
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
EnableGenMux
static cl::opt< bool > EnableGenMux("hexagon-mux", cl::init(true), cl::Hidden, cl::desc("Enable converting conditional transfers into MUX instructions"))
SchedCustomRegistry
static MachineSchedRegistry SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler", createVLIWMachineSched)
DisableHardwareLoops
static cl::opt< bool > DisableHardwareLoops("disable-hexagon-hwloops", cl::Hidden, cl::desc("Disable Hardware Loops for Hexagon target"))
llvm::createHexagonISelDag
FunctionPass * createHexagonISelDag(HexagonTargetMachine &TM, CodeGenOpt::Level OptLevel)
createHexagonISelDag - This pass converts a legalized DAG into a Hexagon-specific DAG,...
Definition: HexagonISelDAGToDAG.cpp:60
EnableEarlyIf
static cl::opt< bool > EnableEarlyIf("hexagon-eif", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable early if-conversion"))
llvm::HexagonTargetMachine::registerPassBuilderCallbacks
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline with New Pass Manager (similar to adjustPassManager for ...
Definition: HexagonTargetMachine.cpp:284
llvm::initializeHexagonBitSimplifyPass
void initializeHexagonBitSimplifyPass(PassRegistry &Registry)
llvm::TargetMachine::TargetFS
std::string TargetFS
Definition: TargetMachine.h:101
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:245
llvm::Attribute::getValueAsString
StringRef getValueAsString() const
Return the attribute's value as a string.
Definition: Attributes.cpp:304
llvm::None
const NoneType None
Definition: None.h:23
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Hexagon.h
llvm::TargetMachine::resetTargetOptions
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Definition: TargetMachine.cpp:56
llvm::HexagonLoopIdiomRecognitionPass
Definition: HexagonLoopIdiomRecognition.h:17
llvm::legacy::PassManagerBase::add
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
llvm::PassManagerBuilder
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
Definition: PassManagerBuilder.h:58
llvm::createHexagonGenInsert
FunctionPass * createHexagonGenInsert()
Definition: HexagonGenInsert.cpp:1601
llvm::cl::ZeroOrMore
@ ZeroOrMore
Definition: CommandLine.h:120
PB
PassBuilder PB(Machine, PassOpts->PTO, None, &PIC)
Passes.h
llvm::TargetPassConfig
Target-Independent Code Generator Pass Configuration Options.
Definition: TargetPassConfig.h:84
llvm::cl::opt< bool >
llvm::initializeHexagonNewValueJumpPass
void initializeHexagonNewValueJumpPass(PassRegistry &)
llvm::createHexagonConstExtenders
FunctionPass * createHexagonConstExtenders()
Definition: HexagonConstExtenders.cpp:2021
llvm::TargetMachine::TargetTriple
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
Definition: TargetMachine.h:99
llvm::createHexagonBitSimplify
FunctionPass * createHexagonBitSimplify()
Definition: HexagonBitSimplify.cpp:3373
EnableExpandCondsets
static cl::opt< bool > EnableExpandCondsets("hexagon-expand-condsets", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Early expansion of MUX"))
llvm::createHexagonOptimizeSZextends
FunctionPass * createHexagonOptimizeSZextends()
Definition: HexagonOptimizeSZextends.cpp:143
llvm::CodeGenOpt::Default
@ Default
Definition: CodeGen.h:55
HexagonNoOpt
static cl::opt< bool > HexagonNoOpt("hexagon-noopt", cl::init(false), cl::Hidden, cl::desc("Disable backend optimizations"))
llvm::createHexagonVectorPrint
FunctionPass * createHexagonVectorPrint()
llvm::EngineKind::JIT
@ JIT
Definition: ExecutionEngine.h:524
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:133
llvm::initializeHexagonLoopIdiomRecognizeLegacyPassPass
void initializeHexagonLoopIdiomRecognizeLegacyPassPass(PassRegistry &)
llvm::HexagonTargetMachine::getTargetTransformInfo
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
Definition: HexagonTargetMachine.cpp:296
llvm::MachineSchedContext
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
Definition: MachineScheduler.h:125
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::TargetPassConfig::addIRPasses
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
Definition: TargetPassConfig.cpp:844
llvm::createHexagonConstPropagationPass
FunctionPass * createHexagonConstPropagationPass()
Definition: HexagonConstPropagation.cpp:3186
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
EnableBitSimplify
static cl::opt< bool > EnableBitSimplify("hexagon-bit", cl::init(true), cl::Hidden, cl::desc("Bit simplification"))
TargetPassConfig.h
llvm::createHexagonCopyToCombine
FunctionPass * createHexagonCopyToCombine()
Definition: HexagonCopyToCombine.cpp:879
HexagonVectorLoopCarriedReuse.h
HexagonMachineScheduler.h
llvm::HexagonExpandCondsetsID
char & HexagonExpandCondsetsID
Definition: HexagonExpandCondsets.cpp:249
llvm::PassBuilder::registerLoopOptimizerEndEPCallback
void registerLoopOptimizerEndEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:415
HexagonISelLowering.h
llvm::createHexagonSplitConst32AndConst64
FunctionPass * createHexagonSplitConst32AndConst64()
Definition: HexagonSplitConst32AndConst64.cpp:109
llvm::PassBuilder::registerLateLoopOptimizationsEPCallback
void registerLateLoopOptimizationsEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:405
EnableVExtractOpt
static cl::opt< bool > EnableVExtractOpt("hexagon-opt-vextract", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable vextract optimization"))
llvm::CodeGenOpt::None
@ None
Definition: CodeGen.h:53
llvm::AArch64::RM
@ RM
Definition: AArch64ISelLowering.h:483
llvm::getTheHexagonTarget
Target & getTheHexagonTarget()
Definition: HexagonTargetInfo.cpp:13
llvm::ScheduleDAG::TRI
const TargetRegisterInfo * TRI
Target processor register info.
Definition: ScheduleDAG.h:559
DisableHexagonCFGOpt
static cl::opt< bool > DisableHexagonCFGOpt("disable-hexagon-cfgopt", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Disable Hexagon CFG Optimization"))
llvm::UnreachableMachineBlockElimID
char & UnreachableMachineBlockElimID
UnreachableMachineBlockElimination - This pass removes unreachable machine basic blocks.
llvm::createHexagonCommonGEP
FunctionPass * createHexagonCommonGEP()
Definition: HexagonCommonGEP.cpp:1292
llvm::createHexagonFixupHwLoops
FunctionPass * createHexagonFixupHwLoops()
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::initializeHexagonConstPropagationPass
void initializeHexagonConstPropagationPass(PassRegistry &Registry)
llvm::createHexagonOptAddrMode
FunctionPass * createHexagonOptAddrMode()
Definition: HexagonOptAddrMode.cpp:897
llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::addPass
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t< is_detected< HasRunOnLoopT, PassT >::value > addPass(PassT &&Pass)
Definition: LoopPassManager.h:108
llvm::Reloc::Static
@ Static
Definition: CodeGen.h:22
llvm::initializeHexagonConstExtendersPass
void initializeHexagonConstExtendersPass(PassRegistry &)
HexagonTargetObjectFile.h
llvm::PICLevel::Level
Level
Definition: CodeGen.h:33
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::getEffectiveRelocModel
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
Definition: AVRTargetMachine.cpp:40
llvm::getEffectiveCodeModel
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.
Definition: TargetMachine.h:498
llvm::LLVMTargetMachine::initAsmInfo
void initAsmInfo()
Definition: LLVMTargetMachine.cpp:41
llvm::HexagonTargetMachine::adjustPassManager
void adjustPassManager(PassManagerBuilder &PMB) override
Allow the target to modify the pass manager, e.g.
Definition: HexagonTargetMachine.cpp:271
llvm::initializeHexagonCopyToCombinePass
void initializeHexagonCopyToCombinePass(PassRegistry &)
DisableHSDR
static cl::opt< bool > DisableHSDR("disable-hsdr", cl::init(false), cl::Hidden, cl::desc("Disable splitting double registers"))
DisableAModeOpt
static cl::opt< bool > DisableAModeOpt("disable-hexagon-amodeopt", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Disable Hexagon Addressing Mode Optimization"))
HexagonLoopIdiomRecognition.h
std
Definition: BitVector.h:850
llvm::HexagonTargetMachine::~HexagonTargetMachine
~HexagonTargetMachine() override
Definition: HexagonTargetMachine.cpp:301
llvm::createHexagonPacketizer
FunctionPass * createHexagonPacketizer(bool Minimal)
Definition: HexagonVLIWPacketizer.cpp:1952
llvm::initializeHexagonSplitDoubleRegsPass
void initializeHexagonSplitDoubleRegsPass(PassRegistry &)
llvm::ScheduleDAG::TII
const TargetInstrInfo * TII
Target instruction information.
Definition: ScheduleDAG.h:558
VLIWMachineScheduler.h
llvm::OptimizationLevel
Definition: OptimizationLevel.h:22
llvm::HexagonTargetMachine::HexagonTargetMachine
HexagonTargetMachine(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)
Definition: HexagonTargetMachine.cpp:218
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:406
llvm::createInstSimplifyLegacyPass
FunctionPass * createInstSimplifyLegacyPass()
Definition: InstSimplifyPass.cpp:129
llvm::PassManagerBuilder::EP_LateLoopOptimizations
@ EP_LateLoopOptimizations
EP_LateLoopOptimizations - This extension point allows adding late loop canonicalization and simplifi...
Definition: PassManagerBuilder.h:111
llvm::initializeHexagonGenMuxPass
void initializeHexagonGenMuxPass(PassRegistry &Registry)
EnableGenExtract
static cl::opt< bool > EnableGenExtract("hexagon-extract", cl::init(true), cl::Hidden, cl::desc("Generate \"extract\" instructions"))
llvm::HexagonTargetMachine::getSubtargetImpl
const HexagonSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Definition: HexagonTargetMachine.cpp:241
EnableVectorCombine
static cl::opt< bool > EnableVectorCombine("hexagon-vector-combine", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable HVX vector combining"))
llvm::SimplifyCFGOptions
Definition: SimplifyCFGOptions.h:23
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
llvm::HexagonVectorLoopCarriedReusePass
Hexagon Vector Loop Carried Reuse Pass.
Definition: HexagonVectorLoopCarriedReuse.h:128
llvm::HexagonSubtarget
Definition: HexagonSubtarget.h:43
llvm::legacy::PassManagerBase
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Definition: LegacyPassManager.h:39
llvm::createHexagonPeephole
FunctionPass * createHexagonPeephole()
Definition: HexagonPeephole.cpp:291
llvm::initializeHexagonRDFOptPass
void initializeHexagonRDFOptPass(PassRegistry &)
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
llvm::createDeadCodeEliminationPass
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:178
llvm::PassManagerBuilder::addExtension
void addExtension(ExtensionPointTy Ty, ExtensionFn Fn)
Definition: PassManagerBuilder.cpp:271
llvm::cl::desc
Definition: CommandLine.h:412
llvm::ScheduleDAGMILive
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
Definition: MachineScheduler.h:390
llvm::ScheduleDAGInstrs
A ScheduleDAG for scheduling lists of MachineInstr.
Definition: ScheduleDAGInstrs.h:119
llvm::createHexagonHardwareLoops
FunctionPass * createHexagonHardwareLoops()
Definition: HexagonHardwareLoops.cpp:374
llvm::IfConverterID
char & IfConverterID
IfConverter - This pass performs machine code if conversion.
Definition: IfConversion.cpp:436
EnableGenInsert
static cl::opt< bool > EnableGenInsert("hexagon-insert", cl::init(true), cl::Hidden, cl::desc("Generate \"insert\" instructions"))
llvm::AttributeList::getFnAttr
Attribute getFnAttr(Attribute::AttrKind Kind) const
Return the attribute object that exists for the function.
Definition: Attributes.h:788
TargetRegistry.h
llvm::HexagonTTIImpl
Definition: HexagonTargetTransformInfo.h:33
llvm::initializeHexagonHardwareLoopsPass
void initializeHexagonHardwareLoopsPass(PassRegistry &)
llvm::TargetMachine::TargetCPU
std::string TargetCPU
Definition: TargetMachine.h:100
llvm::createHexagonGenPredicate
FunctionPass * createHexagonGenPredicate()
Definition: HexagonGenPredicate.cpp:536
llvm::createLoopDataPrefetchPass
FunctionPass * createLoopDataPrefetchPass()
Definition: LoopDataPrefetch.cpp:155
llvm::initializeHexagonVExtractPass
void initializeHexagonVExtractPass(PassRegistry &)