|
LLVM 24.0.0git
|
This class provides access to building LLVM's passes. More...
#include "llvm/Passes/CodeGenPassBuilder.h"
Public Member Functions | |
| CodeGenPassBuilder (TargetMachine &TM, const CGPassBuilderOption &Opts, PassInstrumentationCallbacks *PIC) | |
| CodeGenPassBuilder (const CodeGenPassBuilder &)=delete | |
| CodeGenPassBuilder & | operator= (const CodeGenPassBuilder &)=delete |
| virtual | ~CodeGenPassBuilder () |
| Error | buildPipeline (ModulePassManager &MPM, ModuleAnalysisManager &MAM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Ctx) |
| PassInstrumentationCallbacks * | getPassInstrumentationCallbacks () const |
Protected Types | |
| template<typename PassT> | |
| using | is_module_pass_t |
| template<typename PassT> | |
| using | is_function_pass_t |
| template<typename PassT> | |
| using | is_machine_function_pass_t |
Protected Member Functions | |
| template<typename PassT> | |
| void | addFunctionPass (PassT &&Pass, PassManagerWrapper &PMW, bool Force=false, StringRef Name=PassT::name()) |
| template<typename PassT> | |
| void | addModulePass (PassT &&Pass, PassManagerWrapper &PMW, bool Force=false, StringRef Name=PassT::name()) |
| template<typename PassT> | |
| void | addMachineFunctionPass (PassT &&Pass, PassManagerWrapper &PMW, bool Force=false, StringRef Name=PassT::name()) |
| void | flushFPMsToMPM (PassManagerWrapper &PMW, bool FreeMachineFunctions=false) |
| void | requireCGSCCOrder (PassManagerWrapper &PMW) |
| void | stopAddingInCGSCCOrder (PassManagerWrapper &PMW) |
| CodeGenOptLevel | getOptLevel () const |
| bool | isGlobalISelAbortEnabled () const |
| Check whether or not GlobalISel should abort on error. | |
| bool | reportDiagnosticWhenGlobalISelFallback () const |
| Check whether or not a diagnostic should be emitted when GlobalISel uses the fallback path. | |
| virtual Error | addInstSelector (PassManagerWrapper &PMW) |
| addInstSelector - This method should install an instruction selector pass, which converts from LLVM code to machine instructions. | |
| virtual void | addGlobalMergePass (PassManagerWrapper &PMW) |
| Target can override this to add GlobalMergePass before all IR passes. | |
| virtual void | addILPOpts (PassManagerWrapper &PMW) |
| Add passes that optimize instruction level parallelism for out-of-order targets. | |
| virtual void | addPreRegAlloc (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes immediately before register allocation. | |
| virtual void | addPreRewrite (PassManagerWrapper &PMW) |
| addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is complete, but before virtual registers are rewritten to physical registers. | |
| virtual void | addPostRewrite (PassManagerWrapper &PMW) |
| Add passes to be run immediately after virtual registers are rewritten to physical registers. | |
| virtual void | addPostRegAlloc (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes after register allocation pass pipeline but before prolog-epilog insertion. | |
| virtual void | addPreSched2 (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes after prolog-epilog insertion and before the second instruction scheduling pass. | |
| virtual void | addPreEmitPass (PassManagerWrapper &PMW) |
| This pass may be implemented by targets that want to run passes immediately before machine code is emitted. | |
| virtual void | addPreEmitPass2 (PassManagerWrapper &PMW) |
| Targets may add passes immediately before machine code is emitted in this callback. | |
| virtual void | addPreISel (PassManagerWrapper &PMW) |
| {{@ For GlobalISel | |
| virtual Error | addIRTranslator (PassManagerWrapper &PMW) |
| This method should install an IR translator pass, which converts from LLVM code to machine instructions with possibly generic opcodes. | |
| virtual void | addPreLegalizeMachineIR (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes immediately before legalization. | |
| virtual Error | addLegalizeMachineIR (PassManagerWrapper &PMW) |
| This method should install a legalize pass, which converts the instruction sequence into one that can be selected by the target. | |
| virtual void | addPreRegBankSelect (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes immediately before the register bank selection. | |
| virtual Error | addRegBankSelect (PassManagerWrapper &PMW) |
| This method should install a register bank selector pass, which assigns register banks to virtual registers without a register class or register banks. | |
| virtual void | addPreGlobalInstructionSelect (PassManagerWrapper &PMW) |
| This method may be implemented by targets that want to run passes immediately before the (global) instruction selection. | |
| virtual Error | addGlobalInstructionSelect (PassManagerWrapper &PMW) |
| This method should install a (global) instruction selector pass, which converts possibly generic instructions to fully target-specific instructions, thereby constraining all generic virtual registers to register classes. | |
| void | addISelPasses (PassManagerWrapper &PMW) |
| High level function that adds all passes necessary to go from llvm IR representation to the MI representation. | |
| Error | addCoreISelPasses (PassManagerWrapper &PMW) |
| Add the actual instruction selection passes. | |
| virtual Error | addMachinePasses (PassManagerWrapper &PMW) |
| Add the complete, standard set of LLVM CodeGen passes. | |
| void | addPassesToHandleExceptions (PassManagerWrapper &PMW) |
| Add passes to lower exception handling for the code generator. | |
| virtual void | addIRPasses (PassManagerWrapper &PMW) |
| Add common target configurable passes that perform LLVM IR to IR transforms following machine independent optimization. | |
| virtual void | addCodeGenPrepare (PassManagerWrapper &PMW) |
| Add pass to prepare the LLVM IR for code generation. | |
| virtual void | addISelPrepare (PassManagerWrapper &PMW) |
| Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection. | |
| virtual void | addMachineSSAOptimization (PassManagerWrapper &PMW) |
| Methods with trivial inline returns are convenient points in the common codegen pass pipeline where targets may insert passes. | |
| virtual Error | addFastRegAlloc (PassManagerWrapper &PMW) |
| addFastRegAlloc - Add the minimum set of target-independent passes that are required for fast register allocation. | |
| virtual Error | addOptimizedRegAlloc (PassManagerWrapper &PMW) |
| addOptimizedRegAlloc - Add passes related to register allocation. | |
| virtual void | addMachineLateOptimization (PassManagerWrapper &PMW) |
| Add passes that optimize machine instructions after register allocation. | |
| virtual void | addGCPasses (PassManagerWrapper &PMW) |
| addGCPasses - Add late codegen passes that analyze code for garbage collection. | |
| virtual void | addBlockPlacement (PassManagerWrapper &PMW) |
| Add standard basic block placement passes. | |
| virtual void | addPostBBSections (PassManagerWrapper &PMW) |
| virtual void | addAsmPrinterBegin (PassManagerWrapper &PMW) |
| virtual void | addAsmPrinter (PassManagerWrapper &PMW) |
| virtual void | addAsmPrinterEnd (PassManagerWrapper &PMW) |
| virtual void | addTargetRegisterAllocator (PassManagerWrapper &PMW, bool Optimized) |
| Utilities for targets to add passes to the pass manager. | |
| void | addRegAllocPass (PassManagerWrapper &PMW, bool Optimized) |
| addMachinePasses helper to create the target-selected or overriden regalloc pass. | |
| virtual Error | addRegAssignAndRewriteFast (PassManagerWrapper &PMW) |
| Add core register allocator passes which do the actual register assignment and rewriting. | |
| virtual Expected< bool > | addRegAssignAndRewriteOptimized (PassManagerWrapper &PMW) |
| template<typename... PassTs> | |
| void | disablePass () |
| Allow the target to disable a specific pass by default. | |
| template<typename TargetPassT, typename InsertedPassT> | |
| void | insertPass (InsertedPassT &&Pass) |
| Insert InsertedPass pass after TargetPass pass. | |
Protected Attributes | |
| TargetMachine & | TM |
| CGPassBuilderOption | Opt |
| PassInstrumentationCallbacks * | PIC |
This class provides access to building LLVM's passes.
Its members provide the baseline state available to passes during their construction. The MachinePassRegistry.def file specifies how to construct all of the built-in passes, and those may reference these members during construction.
Targets customize the pipeline by deriving from this class and overriding the virtual add* hooks below: the addStage hooks replace a whole stage of the pipeline, while the addPreStage / addPostStage hooks inject passes around one. See addMachinePasses for how they fit together.
Dispatch is virtual rather than templated on the derived builder so that the target-independent pipeline is emitted once for the whole build instead of once per target.
Definition at line 86 of file CodeGenPassBuilder.h.
|
protected |
Definition at line 108 of file CodeGenPassBuilder.h.
|
protected |
Definition at line 112 of file CodeGenPassBuilder.h.
|
protected |
Definition at line 104 of file CodeGenPassBuilder.h.
| CodeGenPassBuilder::CodeGenPassBuilder | ( | TargetMachine & | TM, |
| const CGPassBuilderOption & | Opts, | ||
| PassInstrumentationCallbacks * | PIC ) |
Definition at line 139 of file CodeGenPassBuilder.cpp.
References llvm::cl::BOU_UNSET, if(), Opt, PIC, and TM.
Referenced by CodeGenPassBuilder(), operator=(), and R600CodeGenPassBuilder::R600CodeGenPassBuilder().
|
delete |
References CodeGenPassBuilder().
|
virtualdefault |
References buildPipeline(), and MAM.
|
protectedvirtual |
Reimplemented in R600CodeGenPassBuilder.
Definition at line 201 of file CodeGenPassBuilder.cpp.
References llvm_unreachable.
Referenced by buildPipeline().
|
protectedvirtual |
Reimplemented in R600CodeGenPassBuilder.
Definition at line 197 of file CodeGenPassBuilder.cpp.
References llvm_unreachable.
Referenced by buildPipeline().
|
protectedvirtual |
Reimplemented in R600CodeGenPassBuilder.
Definition at line 205 of file CodeGenPassBuilder.cpp.
References llvm_unreachable.
Referenced by buildPipeline().
|
protectedvirtual |
Add standard basic block placement passes.
Definition at line 944 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), and Opt.
Referenced by addMachinePasses().
|
protectedvirtual |
Add pass to prepare the LLVM IR for code generation.
This should be done before exception handling preparation passes.
Definition at line 491 of file CodeGenPassBuilder.cpp.
References addFunctionPass(), getOptLevel(), llvm::None, Opt, and TM.
Referenced by addISelPasses().
|
protected |
Add the actual instruction selection passes.
This does not include preparation passes on IR.
Definition at line 523 of file CodeGenPassBuilder.cpp.
References addGlobalInstructionSelect(), addInstSelector(), addIRTranslator(), addLegalizeMachineIR(), addMachineFunctionPass(), addPreGlobalInstructionSelect(), addPreLegalizeMachineIR(), addPreRegBankSelect(), addRegBankSelect(), llvm::cl::BOU_FALSE, llvm::cl::BOU_TRUE, isGlobalISelAbortEnabled(), llvm::None, Opt, reportDiagnosticWhenGlobalISelFallback(), llvm::Error::success(), and TM.
Referenced by buildPipeline().
|
protectedvirtual |
addFastRegAlloc - Add the minimum set of target-independent passes that are required for fast register allocation.
Add the minimum set of target-independent passes that are required for register allocation.
No coalescing or scheduling.
Definition at line 845 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), and addRegAssignAndRewriteFast().
Referenced by addMachinePasses().
|
inlineprotected |
Definition at line 117 of file CodeGenPassBuilder.h.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass().
Referenced by addCodeGenPrepare(), addIRPasses(), addISelPasses(), addISelPrepare(), and addPassesToHandleExceptions().
|
inlineprotectedvirtual |
addGCPasses - Add late codegen passes that analyze code for garbage collection.
This should return true if GC info should be printed after these passes.
Definition at line 342 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
protectedvirtual |
This method should install a (global) instruction selector pass, which converts possibly generic instructions to fully target-specific instructions, thereby constraining all generic virtual registers to register classes.
Definition at line 192 of file CodeGenPassBuilder.cpp.
References llvm::inconvertibleErrorCode(), and llvm::make_error().
Referenced by addCoreISelPasses().
|
inlineprotectedvirtual |
Target can override this to add GlobalMergePass before all IR passes.
Definition at line 197 of file CodeGenPassBuilder.h.
Referenced by addISelPasses().
|
inlineprotectedvirtual |
Add passes that optimize instruction level parallelism for out-of-order targets.
These passes are run while the machine code is still in SSA form, so they can use MachineTraceMetrics to control their heuristics.
All passes added here should preserve the MachineDominatorTree, MachineLoopInfo, and MachineTraceMetrics analyses.
Definition at line 205 of file CodeGenPassBuilder.h.
Referenced by addMachineSSAOptimization().
|
protectedvirtual |
addInstSelector - This method should install an instruction selector pass, which converts from LLVM code to machine instructions.
Reimplemented in R600CodeGenPassBuilder.
Definition at line 172 of file CodeGenPassBuilder.cpp.
References llvm::inconvertibleErrorCode(), and llvm::make_error().
Referenced by addCoreISelPasses().
|
protectedvirtual |
Add common target configurable passes that perform LLVM IR to IR transforms following machine independent optimization.
Definition at line 378 of file CodeGenPassBuilder.cpp.
References addFunctionPass(), addModulePass(), llvm::createFunctionToLoopPassAdaptor(), flushFPMsToMPM(), getOptLevel(), llvm::detail::InfoMixin< ShadowStackGCLoweringPass >::name(), llvm::None, Opt, and TM.
Referenced by addISelPasses().
|
protectedvirtual |
This method should install an IR translator pass, which converts from LLVM code to machine instructions with possibly generic opcodes.
Definition at line 177 of file CodeGenPassBuilder.cpp.
References llvm::inconvertibleErrorCode(), and llvm::make_error().
Referenced by addCoreISelPasses().
|
protected |
High level function that adds all passes necessary to go from llvm IR representation to the MI representation.
Adds IR based lowering and target specific optimization passes and finally the core instruction selection passes.
Definition at line 356 of file CodeGenPassBuilder.cpp.
References addCodeGenPrepare(), addFunctionPass(), addGlobalMergePass(), addIRPasses(), addISelPrepare(), addModulePass(), addPassesToHandleExceptions(), flushFPMsToMPM(), getOptLevel(), llvm::None, and TM.
Referenced by buildPipeline().
|
protectedvirtual |
Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection.
Definition at line 500 of file CodeGenPassBuilder.cpp.
References addFunctionPass(), addPreISel(), llvm::dbgs(), Opt, requireCGSCCOrder(), and TM.
Referenced by addISelPasses().
|
protectedvirtual |
This method should install a legalize pass, which converts the instruction sequence into one that can be selected by the target.
Definition at line 182 of file CodeGenPassBuilder.cpp.
References llvm::inconvertibleErrorCode(), and llvm::make_error().
Referenced by addCoreISelPasses().
|
inlineprotected |
Definition at line 140 of file CodeGenPassBuilder.h.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), and C().
Referenced by addBlockPlacement(), addCoreISelPasses(), addFastRegAlloc(), addMachineLateOptimization(), addMachinePasses(), addMachineSSAOptimization(), addOptimizedRegAlloc(), addRegAllocPass(), addRegAssignAndRewriteOptimized(), addTargetRegisterAllocator(), and buildPipeline().
|
protectedvirtual |
Add passes that optimize machine instructions after register allocation.
Post RegAlloc Pass Configuration.
Add passes that optimize machine instructions after register allocation.
Definition at line 925 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), Opt, and TM.
Referenced by addMachinePasses().
|
protectedvirtual |
Add the complete, standard set of LLVM CodeGen passes.
Add the complete set of target-independent postISel code generator passes.
Fully developed targets will not generally override this.
This can be read as the standard order of major LLVM CodeGen stages. Stages with nontrivial configuration or multiple passes are broken out below in addStage routines.
Any CodeGenPassBuilder::addXX routine may be overriden by the Target. The addPre/Post methods with empty header implementations allow injecting target-specific fixups just before or after major stages. Additionally, targets have the flexibility to change pass order within a stage by overriding default implementation of addStage routines below. Each technique has maintainability tradeoffs because alternate pass orders are not well supported. addPre/Post works better if the target pass is easily tied to a common pass. But if it has subtle dependencies on multiple passes, the target should override the stage instead.
Add passes that optimize machine instructions after register allocation.
Definition at line 614 of file CodeGenPassBuilder.cpp.
References addBlockPlacement(), addFastRegAlloc(), addGCPasses(), addMachineFunctionPass(), addMachineLateOptimization(), addMachineSSAOptimization(), addModulePass(), addOptimizedRegAlloc(), addPostBBSections(), addPostRegAlloc(), addPreEmitPass(), addPreEmitPass2(), addPreRegAlloc(), addPreSched2(), llvm::cl::BOU_TRUE, llvm::errs(), flushFPMsToMPM(), getOptLevel(), llvm::NeverOutline, llvm::None, Opt, llvm::Error::success(), llvm::TargetDefault, and TM.
Referenced by buildPipeline().
|
protectedvirtual |
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where targets may insert passes.
Add passes that optimize machine instructions in SSA form.
Methods with out-of-line standard implementations are major CodeGen stages called by addMachinePasses. Some targets may override major stages when inserting passes is insufficient, but maintaining overriden stages is more work. addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
Definition at line 736 of file CodeGenPassBuilder.cpp.
References addILPOpts(), addMachineFunctionPass(), and Opt.
Referenced by addMachinePasses().
|
inlineprotected |
Definition at line 127 of file CodeGenPassBuilder.h.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), assert(), and llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::isEmpty().
Referenced by addIRPasses(), addISelPasses(), addMachinePasses(), and buildPipeline().
|
protectedvirtual |
addOptimizedRegAlloc - Add passes related to register allocation.
Add standard target-independent passes that are tightly coupled with optimized register allocation, including coalescing, machine instruction scheduling, and register allocation itself.
CodeGenTargetMachineImpl provides standard regalloc passes for most targets.
Definition at line 854 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), addPostRewrite(), addRegAssignAndRewriteOptimized(), llvm::Expected< T >::get(), Opt, llvm::Error::success(), llvm::Expected< T >::takeError(), and TM.
Referenced by addMachinePasses().
|
protected |
Add passes to lower exception handling for the code generator.
Turn exception handling constructs into something the code generators can handle.
Definition at line 447 of file CodeGenPassBuilder.cpp.
References addFunctionPass(), llvm::AIX, llvm::ARM, llvm::DwarfCFI, llvm::MCAsmInfo::getExceptionHandlingType(), llvm::None, llvm::SjLj, TM, llvm::Wasm, llvm::WinEH, and llvm::ZOS.
Referenced by addISelPasses().
|
inlineprotectedvirtual |
Definition at line 347 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes after register allocation pass pipeline but before prolog-epilog insertion.
Definition at line 231 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
Add passes to be run immediately after virtual registers are rewritten to physical registers.
Definition at line 227 of file CodeGenPassBuilder.h.
Referenced by addOptimizedRegAlloc().
|
inlineprotectedvirtual |
This pass may be implemented by targets that want to run passes immediately before machine code is emitted.
Definition at line 239 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
Targets may add passes immediately before machine code is emitted in this callback.
This is called even later than addPreEmitPass.
Definition at line 246 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes immediately before the (global) instruction selection.
Definition at line 278 of file CodeGenPassBuilder.h.
Referenced by addCoreISelPasses().
|
inlineprotectedvirtual |
{{@ For GlobalISel
addPreISel - This method should add any "last minute" LLVM->LLVM passes (which are run just before instruction selector).
Reimplemented in R600CodeGenPassBuilder.
Definition at line 253 of file CodeGenPassBuilder.h.
Referenced by addISelPrepare().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes immediately before legalization.
Definition at line 261 of file CodeGenPassBuilder.h.
Referenced by addCoreISelPasses().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes immediately before register allocation.
Definition at line 209 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes immediately before the register bank selection.
Definition at line 269 of file CodeGenPassBuilder.h.
Referenced by addCoreISelPasses().
|
inlineprotectedvirtual |
addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is complete, but before virtual registers are rewritten to physical registers.
These passes must preserve VirtRegMap and LiveIntervals, and when running after RABasic or RAGreedy, they should take advantage of LiveRegMatrix. When these passes run, VirtRegMap contains legal physreg assignments for all virtual registers.
Note if the target overloads addRegAssignAndRewriteOptimized, this may not be honored. This is also not generally used for the fast variant, where the allocation and rewriting are done in one pass.
Definition at line 223 of file CodeGenPassBuilder.h.
Referenced by addRegAssignAndRewriteOptimized().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes after prolog-epilog insertion and before the second instruction scheduling pass.
Definition at line 235 of file CodeGenPassBuilder.h.
Referenced by addMachinePasses().
|
protected |
addMachinePasses helper to create the target-selected or overriden regalloc pass.
Find and instantiate the register allocation pass requested by this target at the current optimization level.
Different register allocators are defined as separate passes because they may require different analysis.
This helper ensures that the -regalloc-npm= option is always available, even for targets that override the default allocator.
Definition at line 802 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), addTargetRegisterAllocator(), llvm::Default, llvm::Fast, llvm::Greedy, Opt, and llvm::reportFatalUsageError().
Referenced by addRegAssignAndRewriteFast(), and addRegAssignAndRewriteOptimized().
|
protectedvirtual |
Add core register allocator passes which do the actual register assignment and rewriting.
addRegAssignAndRewriteOptimized should return true if any passes were added.
Definition at line 823 of file CodeGenPassBuilder.cpp.
References addRegAllocPass(), and llvm::Error::success().
Referenced by addFastRegAlloc().
|
protectedvirtual |
Definition at line 830 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass(), addPreRewrite(), and addRegAllocPass().
Referenced by addOptimizedRegAlloc().
|
protectedvirtual |
This method should install a register bank selector pass, which assigns register banks to virtual registers without a register class or register banks.
Definition at line 187 of file CodeGenPassBuilder.cpp.
References llvm::inconvertibleErrorCode(), and llvm::make_error().
Referenced by addCoreISelPasses().
|
protectedvirtual |
Utilities for targets to add passes to the pass manager.
Register Allocation Pass Configuration.
Create the register allocator pass for this target at the current optimization level.
Instantiate the default register allocator pass for this target for either the optimized or unoptimized allocation path. This will be added to the pass manager by addFastRegAlloc in the unoptimized case or addOptimizedRegAlloc in the optimized case.
A target that uses the standard regalloc pass order for fast or optimized allocation may still override this for per-target regalloc selection. But -regalloc-npm=... always takes precedence. If a target does not want to allow users to set -regalloc-npm=... at all, check if Opt.RegAlloc == RegAllocType::Unset.
Definition at line 788 of file CodeGenPassBuilder.cpp.
References addMachineFunctionPass().
Referenced by addRegAllocPass().
| Error CodeGenPassBuilder::buildPipeline | ( | ModulePassManager & | MPM, |
| ModuleAnalysisManager & | MAM, | ||
| raw_pwrite_stream & | Out, | ||
| raw_pwrite_stream * | DwoOut, | ||
| CodeGenFileType | FileType, | ||
| MCContext & | Ctx ) |
Definition at line 229 of file CodeGenPassBuilder.cpp.
References addAsmPrinter(), addAsmPrinterBegin(), addAsmPrinterEnd(), addCoreISelPasses(), addISelPasses(), addMachineFunctionPass(), addMachinePasses(), addModulePass(), llvm::createStringError(), flushFPMsToMPM(), llvm::TargetPassConfig::getStartStopInfo(), MAM, llvm::Null, Opt, PIC, Printer, llvm::Expected< T >::takeError(), TM, and llvm::TargetPassConfig::willCompleteCodeGenPipeline().
Referenced by llvm::R600TargetMachine::buildCodeGenPipeline(), and ~CodeGenPassBuilder().
|
inlineprotected |
Allow the target to disable a specific pass by default.
Backend can declare unwanted passes in constructor.
Definition at line 376 of file CodeGenPassBuilder.h.
|
protected |
Definition at line 209 of file CodeGenPassBuilder.cpp.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::createCGSCCToFunctionPassAdaptor(), llvm::createFunctionToMachineFunctionPassAdaptor(), llvm::createModuleToFunctionPassAdaptor(), llvm::createModuleToPostOrderCGSCCPassAdaptor(), and llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::isEmpty().
Referenced by addIRPasses(), addISelPasses(), addMachinePasses(), and buildPipeline().
|
inlineprotected |
Definition at line 176 of file CodeGenPassBuilder.h.
References TM.
Referenced by addCodeGenPrepare(), addIRPasses(), addISelPasses(), and addMachinePasses().
|
inline |
Definition at line 98 of file CodeGenPassBuilder.h.
References PIC.
|
inlineprotected |
Insert InsertedPass pass after TargetPass pass.
Only machine function passes are supported.
Definition at line 384 of file CodeGenPassBuilder.h.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass().
|
inlineprotected |
Check whether or not GlobalISel should abort on error.
When this is disabled, GlobalISel will fall back on SDISel instead of erroring out.
Definition at line 181 of file CodeGenPassBuilder.h.
References llvm::Enable, and TM.
Referenced by addCoreISelPasses().
|
delete |
References CodeGenPassBuilder().
|
inlineprotected |
Check whether or not a diagnostic should be emitted when GlobalISel uses the fallback path.
In other words, it will emit a diagnostic when GlobalISel failed and isGlobalISelAbortEnabled is false.
Definition at line 188 of file CodeGenPassBuilder.h.
References llvm::DisableWithDiag, and TM.
Referenced by addCoreISelPasses().
|
inlineprotected |
Definition at line 156 of file CodeGenPassBuilder.h.
References assert(), and llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::isEmpty().
Referenced by addISelPrepare().
|
inlineprotected |
Definition at line 164 of file CodeGenPassBuilder.h.
References assert(), and llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::isEmpty().
|
protected |
Definition at line 173 of file CodeGenPassBuilder.h.
Referenced by addBlockPlacement(), addCodeGenPrepare(), addCoreISelPasses(), addIRPasses(), addISelPrepare(), addMachineLateOptimization(), addMachinePasses(), addMachineSSAOptimization(), addOptimizedRegAlloc(), addRegAllocPass(), buildPipeline(), CodeGenPassBuilder(), and R600CodeGenPassBuilder::R600CodeGenPassBuilder().
|
protected |
Definition at line 174 of file CodeGenPassBuilder.h.
Referenced by buildPipeline(), CodeGenPassBuilder(), getPassInstrumentationCallbacks(), and R600CodeGenPassBuilder::R600CodeGenPassBuilder().
|
protected |
Definition at line 172 of file CodeGenPassBuilder.h.
Referenced by addCodeGenPrepare(), addCoreISelPasses(), addIRPasses(), addISelPasses(), addISelPrepare(), addMachineLateOptimization(), addMachinePasses(), addOptimizedRegAlloc(), addPassesToHandleExceptions(), buildPipeline(), CodeGenPassBuilder(), getOptLevel(), isGlobalISelAbortEnabled(), R600CodeGenPassBuilder::R600CodeGenPassBuilder(), and reportDiagnosticWhenGlobalISelFallback().