13#ifndef LLVM_CODEGEN_TARGETPASSCONFIG_H
14#define LLVM_CODEGEN_TARGETPASSCONFIG_H
59 bool IsInstance =
false;
70 assert(!IsInstance &&
"Not a Pass ID");
75 assert(IsInstance &&
"Not a Pass Instance");
88 const CodeGenOptions &Opts;
94 unsigned StartBeforeInstanceNum = 0;
95 unsigned StartBeforeCount = 0;
97 unsigned StartAfterInstanceNum = 0;
98 unsigned StartAfterCount = 0;
100 unsigned StopBeforeInstanceNum = 0;
101 unsigned StopBeforeCount = 0;
103 unsigned StopAfterInstanceNum = 0;
104 unsigned StopAfterCount = 0;
107 bool Stopped =
false;
108 bool AddingMachinePasses =
false;
109 bool DebugifyIsSafe =
true;
121 void setStartStopPasses();
168 template<
typename TMC> TMC &
getTM()
const {
169 return *
static_cast<TMC*
>(
TM);
179 bool hasLimitedCodeGenPipeline()
const;
183 bool willCompleteCodeGenPipeline()
const;
188 std::string getLimitedCodeGenPipelineReason()
const;
202 LLVM_ABI std::string getLimitReason()
const;
255 bool isPassSubstitutedOrOverridden(
AnalysisID ID)
const;
258 bool getOptimizeRegAlloc()
const;
262 bool usingDefaultRegAlloc()
const;
269 bool addISelPasses();
273 virtual void addIRPasses();
276 virtual void addPassesToHandleExceptions();
280 virtual void addCodeGenPrepare();
284 virtual void addISelPrepare();
325 virtual void addMachinePasses();
329 void printAndVerify(
const std::string &Banner);
332 void addPrintPass(
const std::string &Banner);
336 void addVerifyPass(
const std::string &Banner);
339 void addDebugifyPass();
342 void addStripDebugPass();
345 void addCheckDebugPass();
349 void addMachinePrePasses(
bool AllowDebugify =
true);
353 void addMachinePostPasses(
const std::string &Banner);
358 bool isGlobalISelAbortEnabled()
const;
363 virtual bool reportDiagnosticWhenGlobalISelFallback()
const;
366 virtual std::unique_ptr<CSEConfigBase> getCSEConfig()
const;
370 void setOpt(
bool &Opt,
bool Val);
373 bool isCustomizedRegAlloc();
390 virtual void addMachineSSAOptimization();
412 virtual FunctionPass *createTargetRegisterAllocator(
bool Optimized);
416 virtual void addFastRegAlloc();
421 virtual void addOptimizedRegAlloc();
448 virtual void addMachineLateOptimization();
457 virtual bool addGCPasses();
460 virtual void addBlockPlacement();
487 void addPass(
Pass *
P);
491 virtual FunctionPass *createRegAllocPass(
bool Optimized);
495 virtual bool addRegAssignAndRewriteFast();
496 virtual bool addRegAssignAndRewriteOptimized();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
print mir2vec MIR2Vec Vocabulary Printer Pass
PassInstrumentationCallbacks PIC
Tagged union holding either a T or a Error.
FunctionPass class - This class is used to implement most global optimizations.
Discriminated union of Pass ID types.
Pass * getInstance() const
IdentifyingPassPtr(AnalysisID IDPtr)
IdentifyingPassPtr(Pass *InstancePtr)
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
Pass interface - Implemented by all 'passes'.
Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
void enablePass(AnalysisID PassID)
Allow the target to enable a specific standard pass by default.
bool requiresCodeGenSCCOrder() const
virtual void addPreLegalizeMachineIR()
This method may be implemented by targets that want to run passes immediately before legalization.
virtual void addPreEmitPass2()
Targets may add passes immediately before machine code is emitted in this callback.
bool RequireCodeGenSCCOrder
Require processing of functions such that callees are generated before callers.
bool EnableLoopTermFold
Enable LoopTermFold immediately after LSR.
bool getEnableTailMerge() const
bool EnableSSAMachineScheduler
Enable insertion of SSAMachineScheduler pass, this triggers early computation of live intervals.
virtual bool isMachinePipelinerEnabled() const
Return true if the MachinePipeliner should run before addPreRegAlloc by default.
virtual void addPreSched2()
This method may be implemented by targets that want to run passes after prolog-epilog insertion and b...
virtual bool addILPOpts()
Add passes that optimize instruction level parallelism for out-of-order targets.
virtual void addPostRegAlloc()
This method may be implemented by targets that want to run passes after register allocation pass pipe...
MachineVerifierMode getMachineVerifierMode() const
Return where the machine verifier runs in the pipeline.
virtual bool addInstSelector()
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
bool getEnableSinkAndFold() const
virtual bool addPreISel()
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
void setOpt(bool &Opt, bool Val)
bool getEnableSSAMachineScheduler() const
virtual void addPostBBSections()
This pass may be implemented by targets that want to run passes immediately after basic block section...
virtual void addPreEmitPass()
This pass may be implemented by targets that want to run passes immediately before machine code is em...
virtual void addPreRegBankSelect()
This method may be implemented by targets that want to run passes immediately before the register ban...
virtual bool addPreRewrite()
addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is...
virtual bool addRegBankSelect()
This method should install a register bank selector pass, which assigns register banks to virtual reg...
void setEnableSinkAndFold(bool Enable)
void setRequiresCodeGenSCCOrder(bool Enable=true)
virtual void addPreGlobalInstructionSelect()
This method may be implemented by targets that want to run passes immediately before the (global) ins...
virtual bool addLegalizeMachineIR()
This method should install a legalize pass, which converts the instruction sequence into one that can...
void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID)
Allow the target to override a specific pass without overriding the pass pipeline.
void disablePass(AnalysisID PassID)
Allow the target to disable a specific standard pass by default.
virtual bool addGlobalInstructionSelect()
This method should install a (global) instruction selector pass, which converts possibly generic inst...
virtual void addPreRegAlloc()
This method may be implemented by targets that want to run passes immediately before register allocat...
bool EnableSinkAndFold
Enable sinking of instructions in MachineSink where a computation can be folded into the addressing m...
bool EnableTailMerge
Default setting for -enable-tail-merge on this target.
bool addCoreISelPasses()
Add the actual instruction selection passes.
void setEnableTailMerge(bool Enable)
TargetPassConfig(TargetMachine &TM, PassManagerBase &PM)
void setDisableVerify(bool Disable)
TMC & getTM() const
Get the right type of TargetMachine for this target.
void setEnableSSAMachineScheduler(bool Enable)
MachineVerifierMode VerifyMode
virtual bool addIRTranslator()
This method should install an IR translator pass, which converts from LLVM code to machine instructio...
bool EnableLoopStrengthReduce
Run loop strength reduction on optimized builds.
virtual void addPostRewrite()
Add passes to be run immediately after virtual registers are rewritten to physical registers.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void registerCodeGenCallback(PassInstrumentationCallbacks &PIC, TargetMachine &)
LLVM_ABI Pass * callDefaultCtor< TargetPassConfig >()
TargetPassConfig needs a TargetMachine; the pass registry cannot create one.
CodeGenOptLevel
Code generation optimization level.
MachineVerifierMode
Specify where the machine verifier runs in the codegen pipeline.
@ End
Run the machine verifier once, at the end of the pipeline.
bool isLimited() const
Returns true if a start or stop pass is set.
unsigned StartInstanceNum