13 #ifndef LLVM_CODEGEN_TARGETPASSCONFIG_H 14 #define LLVM_CODEGEN_TARGETPASSCONFIG_H 23 class LLVMTargetMachine;
24 struct MachineSchedContext;
26 class ScheduleDAGInstrs;
57 bool IsInstance =
false;
68 assert(!IsInstance &&
"Not a Pass ID");
73 assert(IsInstance &&
"Not a Pass Instance");
91 unsigned StartBeforeInstanceNum = 0;
92 unsigned StartBeforeCount = 0;
94 unsigned StartAfterInstanceNum = 0;
95 unsigned StartAfterCount = 0;
97 unsigned StopBeforeInstanceNum = 0;
98 unsigned StopBeforeCount = 0;
100 unsigned StopAfterInstanceNum = 0;
101 unsigned StopAfterCount = 0;
104 bool Stopped =
false;
105 bool AddingMachinePasses =
false;
117 void setStartStopPasses();
122 bool Initialized =
false;
126 bool DisableVerify =
false;
129 bool EnableTailMerge =
true;
133 bool RequireCodeGenSCCOrder =
false;
137 bool addCoreISelPasses();
149 template<
typename TMC> TMC &
getTM()
const {
150 return *
static_cast<TMC*
>(
TM);
160 static bool hasLimitedCodeGenPipeline();
164 static bool willCompleteCodeGenPipeline();
170 getLimitedCodeGenPipelineReason(
const char *Separator =
"/")
const;
179 setOpt(RequireCodeGenSCCOrder,
Enable);
189 bool VerifyAfter =
true,
bool PrintAfter =
true);
205 bool isPassSubstitutedOrOverridden(
AnalysisID ID)
const;
208 bool getOptimizeRegAlloc()
const;
212 bool usingDefaultRegAlloc()
const;
219 bool addISelPasses();
223 virtual void addIRPasses();
226 void addPassesToHandleExceptions();
230 virtual void addCodeGenPrepare();
234 virtual void addISelPrepare();
275 virtual void addMachinePasses();
300 void printAndVerify(
const std::string &Banner);
303 void addPrintPass(
const std::string &Banner);
307 void addVerifyPass(
const std::string &Banner);
312 bool isGlobalISelAbortEnabled()
const;
317 virtual bool reportDiagnosticWhenGlobalISelFallback()
const;
321 virtual bool isGISelCSEEnabled()
const;
324 virtual std::unique_ptr<CSEConfigBase> getCSEConfig()
const;
328 void setOpt(
bool &Opt,
bool Val);
345 virtual void addMachineSSAOptimization();
363 virtual FunctionPass *createTargetRegisterAllocator(
bool Optimized);
367 virtual void addFastRegAlloc();
371 virtual void addOptimizedRegAlloc();
398 virtual void addMachineLateOptimization();
407 virtual bool addGCPasses();
410 virtual void addBlockPlacement();
433 bool printAfter =
true);
442 void addPass(
Pass *
P,
bool verifyAfter =
true,
bool printAfter =
true);
446 virtual FunctionPass *createRegAllocPass(
bool Optimized);
450 virtual bool addRegAssignmentFast();
451 virtual bool addRegAssignmentOptimized();
456 #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.
This class represents lattice values for constants.
virtual void addPreEmitPass2()
Targets may add passes immediately before machine code is emitted in this callback.
virtual void addPostRewrite()
Add passes to be run immediately after virtual registers are rewritten to physical registers...
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...
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)
virtual bool addIRTranslator()
This method should install an IR translator pass, which converts from LLVM code to machine instructio...