14 #ifndef LLVM_CODEGEN_TARGETPASSCONFIG_H 15 #define LLVM_CODEGEN_TARGETPASSCONFIG_H 24 class LLVMTargetMachine;
25 struct MachineSchedContext;
27 class ScheduleDAGInstrs;
57 bool IsInstance =
false;
68 assert(!IsInstance &&
"Not a Pass ID");
73 assert(IsInstance &&
"Not a Pass Instance");
79 static const bool value =
true;
95 bool AddingMachinePasses =
false;
107 void setStartStopPasses();
112 bool Initialized =
false;
116 bool DisableVerify =
false;
119 bool EnableTailMerge =
true;
123 bool RequireCodeGenSCCOrder =
false;
127 bool addCoreISelPasses();
139 template<
typename TMC> TMC &
getTM()
const {
140 return *
static_cast<TMC*
>(
TM);
154 bool hasLimitedCodeGenPipeline()
const;
160 getLimitedCodeGenPipelineReason(
const char *Separator =
"/")
const;
166 return !hasLimitedCodeGenPipeline() || (!StopAfter && !StopBefore);
176 setOpt(RequireCodeGenSCCOrder,
Enable);
186 bool VerifyAfter =
true,
bool PrintAfter =
true);
202 bool isPassSubstitutedOrOverridden(
AnalysisID ID)
const;
205 bool getOptimizeRegAlloc()
const;
209 bool usingDefaultRegAlloc()
const;
216 bool addISelPasses();
220 virtual void addIRPasses();
223 void addPassesToHandleExceptions();
227 virtual void addCodeGenPrepare();
231 virtual void addISelPrepare();
272 virtual void addMachinePasses();
297 void printAndVerify(
const std::string &Banner);
300 void addPrintPass(
const std::string &Banner);
304 void addVerifyPass(
const std::string &Banner);
309 bool isGlobalISelAbortEnabled()
const;
314 virtual bool reportDiagnosticWhenGlobalISelFallback()
const;
318 void setOpt(
bool &Opt,
bool Val);
335 virtual void addMachineSSAOptimization();
353 virtual FunctionPass *createTargetRegisterAllocator(
bool Optimized);
357 virtual void addFastRegAlloc(
FunctionPass *RegAllocPass);
361 virtual void addOptimizedRegAlloc(
FunctionPass *RegAllocPass);
380 virtual void addMachineLateOptimization();
389 virtual bool addGCPasses();
392 virtual void addBlockPlacement();
415 bool printAfter =
true);
424 void addPass(
Pass *
P,
bool verifyAfter =
true,
bool printAfter =
true);
433 #endif // LLVM_CODEGEN_TARGETPASSCONFIG_H Pass interface - Implemented by all 'passes'.
void enablePass(AnalysisID PassID)
Allow the target to enable a specific standard pass by default.
Compute iterated dominance frontiers using a linear time algorithm.
virtual void addPreEmitPass2()
Targets may add passes immediately before machine code is emitted in this callback.
void setDisableVerify(bool Disable)
virtual bool addPreRewrite()
addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is...
bool requiresCodeGenSCCOrder() const
TMC & getTM() const
Get the right type of TargetMachine for this target.
block Block Frequency true
void setRequiresCodeGenSCCOrder(bool Enable=true)
virtual void addPreEmitPass()
This pass may be implemented by targets that want to run passes immediately before machine code is em...
virtual bool addLegalizeMachineIR()
This method should install a legalize pass, which converts the instruction sequence into one that can...
IdentifyingPassPtr(Pass *InstancePtr)
virtual void addPreSched2()
This method may be implemented by targets that want to run passes after prolog-epilog insertion and b...
Target-Independent Code Generator Pass Configuration Options.
virtual void addPreLegalizeMachineIR()
This method may be implemented by targets that want to run passes immediately before legalization...
virtual void addPreRegAlloc()
This method may be implemented by targets that want to run passes immediately before register allocat...
virtual bool addILPOpts()
Add passes that optimize instruction level parallelism for out-of-order targets.
bool getEnableTailMerge() const
static PassOptionList PrintAfter("print-after", llvm::cl::desc("Print IR after specified passes"), cl::Hidden)
void disablePass(AnalysisID PassID)
Allow the target to disable a specific standard pass by default.
void setEnableTailMerge(bool Enable)
virtual bool addInstSelector()
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
This class describes a target machine that is implemented with the LLVM target-independent code gener...
virtual bool addPreISel()
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
FunctionPass class - This class is used to implement most global optimizations.
virtual ScheduleDAGInstrs * createPostMachineScheduler(MachineSchedContext *C) const
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
void pm(uint64_t &Value)
Adjusts a program memory address.
virtual void addPreRegBankSelect()
This method may be implemented by targets that want to run passes immediately before the register ban...
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
ImmutablePass class - This class is used to provide information that does not need to be run...
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
virtual bool addGlobalInstructionSelect()
This method should install a (global) instruction selector pass, which converts possibly generic inst...
virtual void addPostRegAlloc()
This method may be implemented by targets that want to run passes after register allocation pass pipe...
Discriminated union of Pass ID types.
virtual bool addRegBankSelect()
This method should install a register bank selector pass, which assigns register banks to virtual reg...
A ScheduleDAG for scheduling lists of MachineInstr.
virtual void addPreGlobalInstructionSelect()
This method may be implemented by targets that want to run passes immediately before the (global) ins...
Pass * getInstance() const
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
IdentifyingPassPtr(AnalysisID IDPtr)
bool willCompleteCodeGenPipeline() const
Check if the codegen pipeline is limited in such a way that it won't be complete. ...
virtual bool addIRTranslator()
This method should install an IR translator pass, which converts from LLVM code to machine instructio...