42 cl::desc(
"Disable Hexagon Addressing Mode Optimization"));
46 cl::desc(
"Disable Hexagon CFG Optimization"));
71 cl::desc(
"Enable converting conditional transfers into MUX instructions"));
75 "predicate instructions"));
79 cl::desc(
"Enable loop data prefetch on Hexagon"));
82 cl::desc(
"Disable splitting double registers"));
95 cl::desc(
"Enable Hexagon Vector print instr pass"));
102 cl::desc(
"Simplify the CFG after atomic expansion pass"));
110 int HexagonTargetMachineModule = 0;
115 DAG->
addMutation(make_unique<HexagonSubtarget::UsrOverflowMutation>());
116 DAG->
addMutation(make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
117 DAG->
addMutation(make_unique<HexagonSubtarget::CallMutation>());
215 "e-m:e-p:32:32:32-a:0-n16:32-" 216 "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-" 217 "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048",
241 auto &
I = SubtargetMap[CPU + FS];
247 I = llvm::make_unique<HexagonSubtarget>(
TargetTriple, CPU, FS, *
this);
281 return getTM<HexagonTargetMachine>();
289 void addIRPasses()
override;
290 bool addInstSelector()
override;
291 void addPreRegAlloc()
override;
292 void addPostRegAlloc()
override;
293 void addPreSched2()
override;
294 void addPreEmitPass()
override;
299 return new HexagonPassConfig(*
this, PM);
302 void HexagonPassConfig::addIRPasses() {
326 bool HexagonPassConfig::addInstSelector() {
365 void HexagonPassConfig::addPreRegAlloc() {
380 void HexagonPassConfig::addPostRegAlloc() {
391 void HexagonPassConfig::addPreSched2() {
398 void HexagonPassConfig::addPreEmitPass() {
Pass interface - Implemented by all 'passes'.
FunctionPass * createHexagonCopyToCombine()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
char & HexagonExpandCondsetsID
static cl::opt< bool > EnableGenExtract("hexagon-extract", cl::init(true), cl::Hidden, cl::desc("Generate \xtract\instructions"))
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...
void initializeHexagonRDFOptPass(PassRegistry &)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
This class represents lattice values for constants.
Extend the standard ScheduleDAGMI to provide more context and override the top-level schedule() drive...
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
FunctionPass * createHexagonVectorPrint()
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
void initializeHexagonHardwareLoopsPass(PassRegistry &)
static cl::opt< bool > DisableStoreWidening("disable-store-widen", cl::Hidden, cl::init(false), cl::desc("Disable store widening"))
static cl::opt< bool > EnableLoopPrefetch("hexagon-loop-prefetch", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable loop data prefetch on Hexagon"))
static cl::opt< bool > EnableCExtOpt("hexagon-cext", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable Hexagon constant-extender optimization"))
char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
static cl::opt< bool > DisableHCP("disable-hcp", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Disable Hexagon constant propagation"))
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
FunctionPass * createHexagonHardwareLoops()
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&... args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
MachineSchedRegistry provides a selection of available machine instruction schedulers.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
FunctionPass * createHexagonGenPredicate()
FunctionPass * createLoopDataPrefetchPass()
FunctionPass * createHexagonCommonGEP()
FunctionPass * createCFGSimplificationPass(unsigned Threshold=1, bool ForwardSwitchCond=false, bool ConvertSwitch=false, bool KeepLoops=true, bool SinkCommon=false, std::function< bool(const Function &)> Ftor=nullptr)
void initializeHexagonConstPropagationPass(PassRegistry &Registry)
static cl::opt< bool > EnableRDFOpt("rdf-opt", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable RDF-based optimizations"))
void initializeHexagonGenMuxPass(PassRegistry &Registry)
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
FunctionPass * createHexagonOptimizeSZextends()
FunctionPass * createConstantPropagationPass()
static cl::opt< bool > DisableHardwareLoops("disable-hexagon-hwloops", cl::Hidden, cl::desc("Disable Hardware Loops for Hexagon target"))
No attributes have been set.
Target-Independent Code Generator Pass Configuration Options.
~HexagonTargetMachine() override
static cl::opt< bool > EnableGenPred("hexagon-gen-pred", cl::init(true), cl::Hidden, cl::desc("Enable conversion of arithmetic operations to " "predicate instructions"))
char & UnreachableMachineBlockElimID
UnreachableMachineBlockElimination - This pass removes unreachable machine basic blocks.
void initializeHexagonConstExtendersPass(PassRegistry &)
FunctionPass * createDeadCodeEliminationPass()
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
void initializeHexagonNewValueJumpPass(PassRegistry &)
FunctionPass * createHexagonConstExtenders()
void initializeHexagonPacketizerPass(PassRegistry &)
FunctionPass * createHexagonBitSimplify()
static cl::opt< bool > EnableExpandCondsets("hexagon-expand-condsets", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Early expansion of MUX"))
AttributeList getAttributes() const
Return the attribute list for this Function.
static cl::opt< bool > EnableEarlyIf("hexagon-eif", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable early if-conversion"))
int HexagonTargetMachineModule
HexagonTargetMachineModule - Note that this is used on hosts that cannot link in a library unless the...
FunctionPass * createHexagonConstPropagationPass()
void initializeHexagonVExtractPass(PassRegistry &)
void initializeHexagonVectorLoopCarriedReusePass(PassRegistry &)
initializer< Ty > init(const Ty &Val)
static cl::opt< bool > EnableVectorPrint("enable-hexagon-vector-print", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable Hexagon Vector print instr pass"))
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
void initializeHexagonLoopIdiomRecognizePass(PassRegistry &)
FunctionPass * createHexagonEarlyIfConversion()
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
static ScheduleDAGInstrs * createVLIWMachineSched(MachineSchedContext *C)
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
static cl::opt< bool > EnableCommGEP("hexagon-commgep", cl::init(true), cl::Hidden, cl::ZeroOrMore, cl::desc("Enable commoning of GEP instructions"))
static cl::opt< bool > EnableGenMux("hexagon-mux", cl::init(true), cl::Hidden, cl::desc("Enable converting conditional transfers into MUX instructions"))
static cl::opt< bool > EnableBitSimplify("hexagon-bit", cl::init(true), cl::Hidden, cl::desc("Bit simplification"))
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"))
static cl::opt< bool > DisableHSDR("disable-hsdr", cl::init(false), cl::Hidden, cl::desc("Disable splitting double registers"))
static cl::opt< bool > DisableAModeOpt("disable-hexagon-amodeopt", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Disable Hexagon Addressing Mode Optimization"))
This class describes a target machine that is implemented with the LLVM target-independent code gener...
static cl::opt< bool > DisableHexagonCFGOpt("disable-hexagon-cfgopt", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Disable Hexagon CFG Optimization"))
FunctionPass class - This class is used to implement most global optimizations.
FunctionPass * createHexagonSplitDoubleRegs()
FunctionPass * createHexagonLoopRescheduling()
FunctionPass * createHexagonStoreWidening()
Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return the attribute object that exists at the given index.
void initializeHexagonEarlyIfConversionPass(PassRegistry &Registry)
Triple - Helper class for working with autoconf configuration names.
FunctionPass * createHexagonBranchRelaxation()
static MachineSchedRegistry SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler", createVLIWMachineSched)
FunctionPass * createHexagonNewValueJump()
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)
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
FunctionPass * createHexagonRDFOpt()
void initializeHexagonBitSimplifyPass(PassRegistry &Registry)
static cl::opt< bool > EnableVExtractOpt("hexagon-opt-vextract", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("Enable vextract optimization"))
Module.h This file contains the declarations for the Module class.
FunctionPass * createHexagonGenMux()
FunctionPass * createHexagonPeephole()
char & MachinePipelinerID
This pass performs software pipelining on machine instructions.
const HexagonSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
FunctionPass * createHexagonVExtract()
std::unique_ptr< ScheduleDAGMutation > createCopyConstrainDAGMutation(const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
FunctionPass * createHexagonGenInsert()
Target - Wrapper for Target specific information.
static cl::opt< bool > HexagonNoOpt("hexagon-noopt", cl::init(false), cl::Hidden, cl::desc("Disable backend optimizations"))
FunctionPass * createHexagonCallFrameInformation()
void initializeHexagonOptAddrModePass(PassRegistry &)
A ScheduleDAG for scheduling lists of MachineInstr.
FunctionPass * createHexagonSplitConst32AndConst64()
Pass * createHexagonVectorLoopCarriedReusePass()
const TargetRegisterInfo * TRI
Target processor register info.
StringRef getValueAsString() const
Return the attribute's value as a string.
FunctionPass * createHexagonFixupHwLoops()
char & IfConverterID
IfConverter - This pass performs machine code if conversion.
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Pass * createHexagonLoopIdiomPass()
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
FunctionPass * createHexagonISelDag(HexagonTargetMachine &TM, CodeGenOpt::Level OptLevel)
const TargetInstrInfo * TII
Target instruction information.
FunctionPass * createHexagonGenExtract()
FunctionPass * createHexagonPacketizer(bool Minimal)
void initializeHexagonSplitDoubleRegsPass(PassRegistry &)
FunctionPass * createHexagonOptAddrMode()
static cl::opt< bool > EnableLoopResched("hexagon-loop-resched", cl::init(true), cl::Hidden, cl::desc("Loop rescheduling"))
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
void adjustPassManager(PassManagerBuilder &PMB) override
Allow the target to modify the pass manager, e.g.
void addExtension(ExtensionPointTy Ty, ExtensionFn Fn)
EP_LateLoopOptimizations - This extension point allows adding late loop canonicalization and simplifi...
FunctionPass * createAtomicExpandPass()
static cl::opt< bool > EnableGenInsert("hexagon-insert", cl::init(true), cl::Hidden, cl::desc("Generate \nsert\instructions"))
void initializeHexagonExpandCondsetsPass(PassRegistry &)
void LLVMInitializeHexagonTarget()
Target & getTheHexagonTarget()
EP_LoopOptimizerEnd - This extension point allows adding loop passes to the end of the loop optimizer...
FunctionPass * createHexagonCFGOptimizer()
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.