|
LLVM
4.0.0
|
Target-Independent Code Generator Pass Configuration Options. More...
#include <TargetPassConfig.h>
Public Member Functions | |
| TargetPassConfig (TargetMachine *tm, PassManagerBase &pm) | |
| TargetPassConfig () | |
| ~TargetPassConfig () override | |
| template<typename TMC > | |
| TMC & | getTM () const |
| Get the right type of TargetMachine for this target. More... | |
| void | setInitialized () |
| CodeGenOpt::Level | getOptLevel () const |
| void | setStartStopPasses (AnalysisID StartBefore, AnalysisID StartAfter, AnalysisID StopBefore, AnalysisID StopAfter) |
| Set the StartAfter, StartBefore and StopAfter passes to allow running only a portion of the normal code-gen pass sequence. More... | |
| void | setDisableVerify (bool Disable) |
| bool | getEnableTailMerge () const |
| void | setEnableTailMerge (bool Enable) |
| void | substitutePass (AnalysisID StandardID, IdentifyingPassPtr TargetID) |
| Allow the target to override a specific pass without overriding the pass pipeline. More... | |
| void | insertPass (AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID, bool VerifyAfter=true, bool PrintAfter=true) |
| Insert InsertedPassID pass after TargetPassID pass. More... | |
| void | enablePass (AnalysisID PassID) |
| Allow the target to enable a specific standard pass by default. More... | |
| void | disablePass (AnalysisID PassID) |
| Allow the target to disable a specific standard pass by default. More... | |
| IdentifyingPassPtr | getPassSubstitution (AnalysisID StandardID) const |
| Return the pass substituted for StandardID by the target. More... | |
| bool | isPassSubstitutedOrOverridden (AnalysisID ID) const |
| Return true if the pass has been substituted by the target or overridden on the command line. More... | |
| bool | getOptimizeRegAlloc () const |
| Return true if the optimized regalloc pipeline is enabled. More... | |
| bool | getEnableShrinkWrap () const |
| Return true if shrink wrapping is enabled. More... | |
| bool | usingDefaultRegAlloc () const |
| Return true if the default global register allocator is in use and has not be overriden on the command line with '-regalloc=...'. More... | |
| virtual void | addIRPasses () |
| Add common target configurable passes that perform LLVM IR to IR transforms following machine independent optimization. More... | |
| void | addPassesToHandleExceptions () |
| Add passes to lower exception handling for the code generator. More... | |
| virtual void | addCodeGenPrepare () |
| Add pass to prepare the LLVM IR for code generation. More... | |
| virtual void | addISelPrepare () |
| Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection. More... | |
| virtual bool | addInstSelector () |
| addInstSelector - This method should install an instruction selector pass, which converts from LLVM code to machine instructions. More... | |
| virtual bool | addIRTranslator () |
| This method should install an IR translator pass, which converts from LLVM code to machine instructions with possibly generic opcodes. More... | |
| virtual void | addPreLegalizeMachineIR () |
| This method may be implemented by targets that want to run passes immediately before legalization. More... | |
| virtual bool | addLegalizeMachineIR () |
| This method should install a legalize pass, which converts the instruction sequence into one that can be selected by the target. More... | |
| virtual void | addPreRegBankSelect () |
| This method may be implemented by targets that want to run passes immediately before the register bank selection. More... | |
| virtual bool | addRegBankSelect () |
| This method should install a register bank selector pass, which assigns register banks to virtual registers without a register class or register banks. More... | |
| virtual void | addPreGlobalInstructionSelect () |
| This method may be implemented by targets that want to run passes immediately before the (global) instruction selection. More... | |
| virtual bool | addGlobalInstructionSelect () |
| 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. More... | |
| virtual void | addMachinePasses () |
| Add the complete, standard set of LLVM CodeGen passes. More... | |
| false **Return NULL to select the | default (generic) machine scheduler.*/virtual ScheduleDAGInstrs *createMachineScheduler(MachineSchedContext *C) const |
| Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this function and target at the current optimization level. More... | |
| virtual ScheduleDAGInstrs * | createPostMachineScheduler (MachineSchedContext *C) const |
| Similar to createMachineScheduler but used when postRA machine scheduling is enabled. More... | |
| void | printAndVerify (const std::string &Banner) |
| printAndVerify - Add a pass to dump then verify the machine function, if those steps are enabled. More... | |
| void | addPrintPass (const std::string &Banner) |
| Add a pass to print the machine function if printing is enabled. More... | |
| void | addVerifyPass (const std::string &Banner) |
| Add a pass to perform basic verification of the machine function if verification is enabled. More... | |
| virtual bool | isGlobalISelAbortEnabled () const |
| Check whether or not GlobalISel should abort on error. More... | |
| virtual bool | reportDiagnosticWhenGlobalISelFallback () const |
| Check whether or not a diagnostic should be emitted when GlobalISel uses the fallback path. More... | |
Public Member Functions inherited from llvm::ImmutablePass | |
| virtual void | initializePass () |
| initializePass - This method may be overriden by immutable passes to allow them to perform various initialization actions they require. More... | |
| ImmutablePass * | getAsImmutablePass () override |
| bool | runOnModule (Module &) override |
| ImmutablePasses are never run. More... | |
| ImmutablePass (char &pid) | |
| ~ImmutablePass () override | |
Public Member Functions inherited from llvm::ModulePass | |
| Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const override |
| createPrinterPass - Get a module printer pass. More... | |
| void | assignPassManager (PMStack &PMS, PassManagerType T) override |
| Find appropriate Module Pass Manager in the PM Stack and add self into that manager. More... | |
| PassManagerType | getPotentialPassManagerType () const override |
| Return what kind of Pass Manager can manage this pass. More... | |
| ModulePass (char &pid) | |
| ~ModulePass () override | |
Public Member Functions inherited from llvm::Pass | |
| Pass (PassKind K, char &pid) | |
| virtual | ~Pass () |
| PassKind | getPassKind () const |
| virtual StringRef | getPassName () const |
| getPassName - Return a nice clean name for a pass. More... | |
| AnalysisID | getPassID () const |
| getPassID - Return the PassID number that corresponds to this pass. More... | |
| virtual bool | doInitialization (Module &) |
| doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. More... | |
| virtual bool | doFinalization (Module &) |
| doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More... | |
| virtual void | print (raw_ostream &O, const Module *M) const |
| print - Print out the internal state of the pass. More... | |
| void | dump () const |
| virtual void | preparePassManager (PMStack &) |
| Check if available pass managers are suitable for this pass or not. More... | |
| void | setResolver (AnalysisResolver *AR) |
| AnalysisResolver * | getResolver () const |
| virtual void | getAnalysisUsage (AnalysisUsage &) const |
| getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. More... | |
| virtual void | releaseMemory () |
| releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. More... | |
| virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
| getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More... | |
| virtual PMDataManager * | getAsPMDataManager () |
| virtual void | verifyAnalysis () const |
| verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More... | |
| virtual void | dumpPassStructure (unsigned Offset=0) |
| template<typename AnalysisType > | |
| AnalysisType * | getAnalysisIfAvailable () const |
| getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More... | |
| bool | mustPreserveAnalysisID (char &AID) const |
| mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysis () const |
| getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysis (Function &F) |
| getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysisID (AnalysisID PI) const |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
| static char | EarlyTailDuplicateID |
| Pseudo Pass IDs. More... | |
| static char | PostRAMachineLICMID = 0 |
| PostRAMachineLICM - A clone of the LICM pass that runs during late machine optimization after regalloc. More... | |
| static char | ID |
Protected Member Functions | |
| void | setOpt (bool &Opt, bool Val) |
| virtual bool | addPreISel () |
| Methods with trivial inline returns are convenient points in the common codegen pass pipeline where targets may insert passes. More... | |
| virtual void | addMachineSSAOptimization () |
| addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form. More... | |
| virtual bool | addILPOpts () |
| Add passes that optimize instruction level parallelism for out-of-order targets. More... | |
| virtual void | addPreRegAlloc () |
| This method may be implemented by targets that want to run passes immediately before register allocation. More... | |
| virtual FunctionPass * | createTargetRegisterAllocator (bool Optimized) |
| createTargetRegisterAllocator - Create the register allocator pass for this target at the current optimization level. More... | |
| virtual void | addFastRegAlloc (FunctionPass *RegAllocPass) |
| addFastRegAlloc - Add the minimum set of target-independent passes that are required for fast register allocation. More... | |
| virtual void | addOptimizedRegAlloc (FunctionPass *RegAllocPass) |
| addOptimizedRegAlloc - Add passes related to register allocation. More... | |
| virtual bool | addPreRewrite () |
| addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is complete, but before virtual registers are rewritten to physical registers. More... | |
| virtual void | addPostRegAlloc () |
| This method may be implemented by targets that want to run passes after register allocation pass pipeline but before prolog-epilog insertion. More... | |
| virtual void | addMachineLateOptimization () |
| Add passes that optimize machine instructions after register allocation. More... | |
| virtual void | addPreSched2 () |
| This method may be implemented by targets that want to run passes after prolog-epilog insertion and before the second instruction scheduling pass. More... | |
| virtual bool | addGCPasses () |
| addGCPasses - Add late codegen passes that analyze code for garbage collection. More... | |
| virtual void | addBlockPlacement () |
| Add standard basic block placement passes. More... | |
| virtual void | addPreEmitPass () |
| This pass may be implemented by targets that want to run passes immediately before machine code is emitted. More... | |
| AnalysisID | addPass (AnalysisID PassID, bool verifyAfter=true, bool printAfter=true) |
| Utilities for targets to add passes to the pass manager. More... | |
| void | addPass (Pass *P, bool verifyAfter=true, bool printAfter=true) |
| Add a pass to the PassManager if that pass is supposed to be run, as determined by the StartAfter and StopAfter options. More... | |
| FunctionPass * | createRegAllocPass (bool Optimized) |
| addMachinePasses helper to create the target-selected or overriden regalloc pass. More... | |
Protected Member Functions inherited from llvm::ModulePass | |
| bool | skipModule (Module &M) const |
| Optional passes call this function to check whether the pass should be skipped. More... | |
Protected Attributes | |
| TargetMachine * | TM |
| PassConfigImpl * | Impl |
| bool | Initialized |
| bool | DisableVerify |
| bool | EnableTailMerge |
| Default setting for -enable-tail-merge on this target. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::Pass | |
| static const PassInfo * | lookupPassInfo (const void *TI) |
| static const PassInfo * | lookupPassInfo (StringRef Arg) |
| static Pass * | createPass (AnalysisID ID) |
Target-Independent Code Generator Pass Configuration Options.
This is an ImmutablePass solely for the purpose of exposing CodeGen options to the internals of other CodeGen passes.
Definition at line 80 of file TargetPassConfig.h.
| TargetPassConfig::TargetPassConfig | ( | TargetMachine * | tm, |
| PassManagerBase & | pm | ||
| ) |
Definition at line 261 of file TargetPassConfig.cpp.
References llvm::PassRegistry::getPassRegistry(), Impl, llvm::initializeAAResultsWrapperPassPass(), llvm::initializeBasicAAWrapperPassPass(), llvm::initializeCodeGen(), llvm::MachineLICMID, llvm::TargetMachine::Options, llvm::TargetOptions::PrintMachineCode, PrintMachineInstrs, substitutePass(), llvm::TailDuplicateID, and TM.
| TargetPassConfig::TargetPassConfig | ( | ) |
Definition at line 309 of file TargetPassConfig.cpp.
References llvm_unreachable.
|
override |
Definition at line 255 of file TargetPassConfig.cpp.
References Impl.
|
protectedvirtual |
Add standard basic block placement passes.
Definition at line 895 of file TargetPassConfig.cpp.
References addPass(), EnableBlockPlacementStats, llvm::MachineBlockPlacementID, and llvm::MachineBlockPlacementStatsID.
Referenced by addMachinePasses().
|
virtual |
Add pass to prepare the LLVM IR for code generation.
This should be done before exception handling preparation passes.
Definition at line 522 of file TargetPassConfig.cpp.
References addPass(), llvm::createCodeGenPreparePass(), llvm::createRewriteSymbolsPass(), DisableCGP, getOptLevel(), llvm::CodeGenOpt::None, and TM.
Referenced by addPassesToGenerateCode().
|
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 802 of file TargetPassConfig.cpp.
References addPass(), llvm::PHIEliminationID, and llvm::TwoAddressInstructionPassID.
Referenced by addMachinePasses().
|
protectedvirtual |
addGCPasses - Add late codegen passes that analyze code for garbage collection.
Add standard GC passes.
This should return true if GC info should be printed after these passes.
Definition at line 889 of file TargetPassConfig.cpp.
References addPass(), and llvm::GCMachineCodeAnalysisID.
Referenced by addMachinePasses().
|
inlinevirtual |
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 250 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
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 326 of file TargetPassConfig.h.
Referenced by addMachineSSAOptimization().
|
inlinevirtual |
addInstSelector - This method should install an instruction selector pass, which converts from LLVM code to machine instructions.
Definition at line 217 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
virtual |
Add common target configurable passes that perform LLVM IR to IR transforms following machine independent optimization.
Definition at line 430 of file TargetPassConfig.cpp.
References addPass(), Andersen, Both, llvm::createBasicAAWrapperPass(), llvm::createCFLAndersAAWrapperPass(), llvm::createCFLSteensAAWrapperPass(), llvm::createConstantHoistingPass(), llvm::createCountingFunctionInserterPass(), llvm::createGCLoweringPass(), llvm::createLoopStrengthReducePass(), llvm::createPartiallyInlineLibCallsPass(), llvm::createPrintFunctionPass(), llvm::createScopedNoAliasAAWrapperPass(), llvm::createShadowStackGCLoweringPass(), llvm::createTypeBasedAAWrapperPass(), llvm::createUnreachableBlockEliminationPass(), llvm::createVerifierPass(), llvm::dbgs(), DisableConstantHoisting, DisableLSR, DisablePartialLibcallInlining, DisableVerify, getOptLevel(), llvm::CodeGenOpt::None, PrintLSR, Steensgaard, and UseCFLAA.
Referenced by addPassesToGenerateCode().
|
inlinevirtual |
This method should install an IR translator pass, which converts from LLVM code to machine instructions with possibly generic opcodes.
Definition at line 223 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
virtual |
Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection.
Definition at line 530 of file TargetPassConfig.cpp.
References addPass(), addPreISel(), llvm::createPrintFunctionPass(), llvm::createSafeStackPass(), llvm::createStackProtectorPass(), llvm::createVerifierPass(), llvm::dbgs(), DisableVerify, llvm::TargetOptions::EnableIPRA, llvm::TargetMachine::Options, PrintISelInput, and TM.
Referenced by addPassesToGenerateCode().
|
inlinevirtual |
This method should install a legalize pass, which converts the instruction sequence into one that can be selected by the target.
Definition at line 231 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
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 873 of file TargetPassConfig.cpp.
References addPass(), llvm::BranchFolderPassID, llvm::MachineCopyPropagationID, llvm::TargetMachine::requiresStructuredCFG(), llvm::TailDuplicateID, and TM.
Referenced by addMachinePasses().
|
virtual |
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 TargetPassConfig::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.
TODO: We could use a single addPre/Post(ID) hook to allow pass injection before/after any target-independent pass. But it's currently overkill.
Add passes that optimize machine instructions after register allocation.
Definition at line 570 of file TargetPassConfig.cpp.
References addBlockPlacement(), addFastRegAlloc(), addGCPasses(), addMachineLateOptimization(), addMachineSSAOptimization(), addOptimizedRegAlloc(), addPass(), addPostRegAlloc(), addPreEmitPass(), addPreRegAlloc(), addPreSched2(), assert(), llvm::createGCInfoPrinter(), llvm::createPrologEpilogInserterPass(), createRegAllocPass(), llvm::createRegUsageInfoCollector(), llvm::createRegUsageInfoPropPass(), llvm::dbgs(), EnableImplicitNullChecks, llvm::TargetOptions::EnableIPRA, llvm::ExpandISelPseudosID, llvm::ExpandPostRAPseudosID, llvm::FuncletLayoutID, getOptimizeRegAlloc(), getOptLevel(), llvm::PassRegistry::getPassInfo(), llvm::PassRegistry::getPassRegistry(), llvm::PassInfo::getTypeInfo(), llvm::ImplicitNullChecksID, insertPass(), isPassSubstitutedOrOverridden(), llvm::LiveDebugValuesID, llvm::LocalStackSlotAllocationID, MISchedPostRA, llvm::CodeGenOpt::None, llvm::TargetMachine::Options, llvm::PatchableFunctionID, llvm::PostMachineSchedulerID, llvm::PostRASchedulerID, printAndVerify(), PrintGCInfo, PrintMachineInstrs, llvm::PrologEpilogCodeInserterID, llvm::ShrinkWrapID, llvm::StackMapLivenessID, llvm::TargetMachine::targetSchedulesPostRAScheduling(), TM, and llvm::XRayInstrumentationID.
Referenced by addPassesToGenerateCode().
|
protectedvirtual |
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
Add passes that optimize machine instructions in SSA form.
Definition at line 678 of file TargetPassConfig.cpp.
References addILPOpts(), addPass(), llvm::DeadMachineInstructionElimID, llvm::LocalStackSlotAllocationID, llvm::MachineCSEID, llvm::MachineLICMID, llvm::MachineSinkingID, llvm::OptimizePHIsID, llvm::PeepholeOptimizerID, and llvm::StackColoringID.
Referenced by addMachinePasses().
|
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.
LLVMTargetMachine provides standard regalloc passes for most targets.
Definition at line 813 of file TargetPassConfig.cpp.
References addPass(), addPreRewrite(), llvm::DetectDeadLanesID, EarlyLiveIntervals, llvm::LiveIntervalsID, llvm::LiveVariablesID, llvm::MachineLoopInfoID, llvm::MachineSchedulerID, llvm::PHIEliminationID, llvm::ProcessImplicitDefsID, llvm::RegisterCoalescerID, llvm::RenameIndependentSubregsID, llvm::StackSlotColoringID, llvm::TwoAddressInstructionPassID, and llvm::VirtRegRewriterID.
Referenced by addMachinePasses().
|
protected |
Utilities for targets to add passes to the pass manager.
Add a CodeGen pass at this point in the pipeline after checking for target and command line overrides.
Add a CodeGen pass at this point in the pipeline after checking overrides. Return the pass that was added, or zero if no pass was added. printAfter if true and adding a machine function pass add an extra machine printer pass afterwards verifyAfter if true and adding a machine function pass add an extra machine verification pass afterwards.
addPass cannot return a pointer to the pass instance because is internal the PassManager and the instance we create here may already be freed.
Definition at line 392 of file TargetPassConfig.cpp.
References llvm::Pass::createPass(), llvm::IdentifyingPassPtr::getID(), llvm::IdentifyingPassPtr::getInstance(), llvm::Pass::getPassID(), getPassSubstitution(), llvm::IdentifyingPassPtr::isInstance(), llvm::IdentifyingPassPtr::isValid(), llvm_unreachable, overridePass(), and P.
Referenced by addBlockPlacement(), addCodeGenPrepare(), addFastRegAlloc(), addGCPasses(), addIRPasses(), addISelPrepare(), addMachineLateOptimization(), addMachinePasses(), addMachineSSAOptimization(), addOptimizedRegAlloc(), addPass(), and addPassesToHandleExceptions().
|
protected |
Add a pass to the PassManager if that pass is supposed to be run, as determined by the StartAfter and StopAfter options.
Add a pass to the PassManager if that pass is supposed to be run.
Takes ownership of the pass. printAfter if true and adding a machine function pass add an extra machine printer pass afterwards verifyAfter if true and adding a machine function pass add an extra machine verification pass afterwards.
If the Started/Stopped flags indicate either that the compilation should start at a later pass or that it should stop after an earlier pass, then do not add the pass. Finally, compare the current pass against the StartAfter and StopAfter options and change the Started/Stopped flags accordingly.
Definition at line 345 of file TargetPassConfig.cpp.
References addPass(), addPrintPass(), addVerifyPass(), assert(), llvm::Pass::getPassID(), llvm::Pass::getPassName(), Impl, Initialized, llvm::PassConfigImpl::InsertedPasses, P, and llvm::report_fatal_error().
| void TargetPassConfig::addPassesToHandleExceptions | ( | ) |
Add passes to lower exception handling for the code generator.
Turn exception handling constructs into something the code generators can handle.
Definition at line 487 of file TargetPassConfig.cpp.
References addPass(), llvm::ARM, assert(), llvm::createDwarfEHPass(), llvm::createLowerInvokePass(), llvm::createSjLjEHPreparePass(), llvm::createUnreachableBlockEliminationPass(), llvm::createWinEHPass(), llvm::DwarfCFI, llvm::MCAsmInfo::getExceptionHandlingType(), llvm::TargetMachine::getMCAsmInfo(), LLVM_FALLTHROUGH, llvm::None, llvm::SjLj, TM, and llvm::WinEH.
Referenced by addPassesToGenerateCode().
|
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 360 of file TargetPassConfig.h.
Referenced by addMachinePasses().
|
inlineprotectedvirtual |
This pass may be implemented by targets that want to run passes immediately before machine code is emitted.
Definition at line 379 of file TargetPassConfig.h.
Referenced by addMachinePasses().
|
inlinevirtual |
This method may be implemented by targets that want to run passes immediately before the (global) instruction selection.
Definition at line 244 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
inlineprotectedvirtual |
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where targets may insert passes.
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.addPreISelPasses - This method should add any "last minute" LLVM->LLVM passes (which are run just before instruction selector).
Definition at line 312 of file TargetPassConfig.h.
Referenced by addISelPrepare().
|
inlinevirtual |
This method may be implemented by targets that want to run passes immediately before legalization.
Definition at line 227 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
inlineprotectedvirtual |
This method may be implemented by targets that want to run passes immediately before register allocation.
Definition at line 332 of file TargetPassConfig.h.
Referenced by addMachinePasses().
|
inlinevirtual |
This method may be implemented by targets that want to run passes immediately before the register bank selection.
Definition at line 235 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
|
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.
Definition at line 354 of file TargetPassConfig.h.
Referenced by addOptimizedRegAlloc().
|
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 367 of file TargetPassConfig.h.
Referenced by addMachinePasses().
| void TargetPassConfig::addPrintPass | ( | const std::string & | Banner | ) |
Add a pass to print the machine function if printing is enabled.
Definition at line 418 of file TargetPassConfig.cpp.
References llvm::createMachineFunctionPrinterPass(), llvm::dbgs(), llvm::TargetMachine::shouldPrintMachineCode(), and TM.
Referenced by addPass(), and printAndVerify().
|
inlinevirtual |
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 240 of file TargetPassConfig.h.
Referenced by addPassesToGenerateCode().
| void TargetPassConfig::addVerifyPass | ( | const std::string & | Banner | ) |
Add a pass to perform basic verification of the machine function if verification is enabled.
Definition at line 423 of file TargetPassConfig.cpp.
References llvm::createMachineVerifierPass(), and VerifyMachineCode.
Referenced by addPass(), and printAndVerify().
|
inlinevirtual |
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
Definition at line 273 of file TargetPassConfig.h.
|
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= option is always available, even for targets that override the default allocator.
FIXME: When MachinePassRegistry register pass IDs instead of function ptrs, this can be folded into addPass.
Definition at line 781 of file TargetPassConfig.cpp.
References llvm::call_once(), createTargetRegisterAllocator(), llvm::RegisterRegAlloc::getDefault(), initializeDefaultRegisterAllocatorOnce(), and useDefaultRegisterAllocator().
Referenced by addMachinePasses().
|
protectedvirtual |
createTargetRegisterAllocator - 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=... always takes precedence.
Definition at line 765 of file TargetPassConfig.cpp.
References llvm::createFastRegisterAllocator(), and llvm::createGreedyRegisterAllocator().
Referenced by createRegAllocPass().
|
inline |
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this function and target at the current optimization level.
This can also be used to plug a new MachineSchedStrategy into an instance of the standard ScheduleDAGMI: return new ScheduleDAGMI(C, make_unique<MyStrategy>(C), /*RemoveKillFlags=
Definition at line 264 of file TargetPassConfig.h.
|
inline |
Allow the target to disable a specific standard pass by default.
Definition at line 178 of file TargetPassConfig.h.
References substitutePass().
|
inline |
Allow the target to enable a specific standard pass by default.
Definition at line 175 of file TargetPassConfig.h.
References substitutePass().
| bool llvm::TargetPassConfig::getEnableShrinkWrap | ( | ) | const |
Return true if shrink wrapping is enabled.
|
inline |
Definition at line 162 of file TargetPassConfig.h.
References EnableTailMerge.
Referenced by INITIALIZE_PASS().
| bool TargetPassConfig::getOptimizeRegAlloc | ( | ) | const |
Return true if the optimized regalloc pipeline is enabled.
Register Allocation Pass Configuration.
Definition at line 719 of file TargetPassConfig.cpp.
References llvm::cl::BOU_FALSE, llvm::cl::BOU_TRUE, llvm::cl::BOU_UNSET, getOptLevel(), llvm_unreachable, llvm::CodeGenOpt::None, and OptimizeRegAlloc.
Referenced by addMachinePasses().
| CodeGenOpt::Level TargetPassConfig::getOptLevel | ( | ) | const |
Definition at line 284 of file TargetPassConfig.cpp.
References llvm::TargetMachine::getOptLevel(), and TM.
Referenced by addCodeGenPrepare(), addIRPasses(), addMachinePasses(), and getOptimizeRegAlloc().
| IdentifyingPassPtr TargetPassConfig::getPassSubstitution | ( | AnalysisID | StandardID | ) | const |
Return the pass substituted for StandardID by the target.
If no substitution exists, return StandardID.
Definition at line 325 of file TargetPassConfig.cpp.
References I, Impl, and llvm::PassConfigImpl::TargetPasses.
Referenced by addPass(), and isPassSubstitutedOrOverridden().
|
inline |
Get the right type of TargetMachine for this target.
Definition at line 128 of file TargetPassConfig.h.
References TM.
| void TargetPassConfig::insertPass | ( | AnalysisID | TargetPassID, |
| IdentifyingPassPtr | InsertedPassID, | ||
| bool | VerifyAfter = true, |
||
| bool | PrintAfter = true |
||
| ) |
Insert InsertedPassID pass after TargetPassID pass.
Insert InsertedPassID pass after TargetPassID.
Definition at line 289 of file TargetPassConfig.cpp.
References assert(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::IdentifyingPassPtr::getID(), llvm::IdentifyingPassPtr::getInstance(), llvm::Pass::getPassID(), Impl, llvm::PassConfigImpl::InsertedPasses, and llvm::IdentifyingPassPtr::isInstance().
Referenced by addMachinePasses().
|
virtual |
Check whether or not GlobalISel should abort on error.
GlobalISel Configuration.
When this is disable, GlobalISel will fall back on SDISel instead of erroring out.
Definition at line 906 of file TargetPassConfig.cpp.
References EnableGlobalISelAbort.
Referenced by addPassesToGenerateCode(), llvm::Legalizer::runOnMachineFunction(), llvm::IRTranslator::runOnMachineFunction(), and llvm::RegBankSelect::runOnMachineFunction().
| bool TargetPassConfig::isPassSubstitutedOrOverridden | ( | AnalysisID | ID | ) | const |
Return true if the pass has been substituted by the target or overridden on the command line.
Definition at line 333 of file TargetPassConfig.cpp.
References llvm::IdentifyingPassPtr::getID(), getPassSubstitution(), ID, llvm::IdentifyingPassPtr::isInstance(), llvm::IdentifyingPassPtr::isValid(), and overridePass().
Referenced by addMachinePasses().
| void TargetPassConfig::printAndVerify | ( | const std::string & | Banner | ) |
printAndVerify - Add a pass to dump then verify the machine function, if those steps are enabled.
Definition at line 413 of file TargetPassConfig.cpp.
References addPrintPass(), and addVerifyPass().
Referenced by addMachinePasses().
|
virtual |
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 910 of file TargetPassConfig.cpp.
References EnableGlobalISelAbort.
Referenced by addPassesToGenerateCode().
|
inline |
Definition at line 160 of file TargetPassConfig.h.
References DisableVerify, and setOpt().
Referenced by addPassesToGenerateCode().
|
inline |
Definition at line 163 of file TargetPassConfig.h.
References EnableTailMerge, and setOpt().
|
inline |
Definition at line 133 of file TargetPassConfig.h.
References Initialized.
Referenced by addPassesToGenerateCode().
Definition at line 315 of file TargetPassConfig.cpp.
References assert(), and Initialized.
Referenced by setDisableVerify(), and setEnableTailMerge().
|
inline |
Set the StartAfter, StartBefore and StopAfter passes to allow running only a portion of the normal code-gen pass sequence.
If the StartAfter and StartBefore pass ID is zero, then compilation will begin at the normal point; otherwise, clear the Started flag to indicate that passes should not be added until the starting pass is seen. If the Stop pass ID is zero, then compilation will continue to the end.
This function expects that at least one of the StartAfter or the StartBefore pass IDs is null.
Definition at line 147 of file TargetPassConfig.h.
References assert().
Referenced by addPassesToGenerateCode().
| void TargetPassConfig::substitutePass | ( | AnalysisID | StandardID, |
| IdentifyingPassPtr | TargetID | ||
| ) |
Allow the target to override a specific pass without overriding the pass pipeline.
When passes are added to the standard pipeline at the point where StandardID is expected, add TargetID in its place.
Definition at line 320 of file TargetPassConfig.cpp.
References Impl, and llvm::PassConfigImpl::TargetPasses.
Referenced by disablePass(), enablePass(), and TargetPassConfig().
| bool TargetPassConfig::usingDefaultRegAlloc | ( | ) | const |
Return true if the default global register allocator is in use and has not be overriden on the command line with '-regalloc=...'.
Definition at line 796 of file TargetPassConfig.cpp.
References RegAlloc.
|
protected |
Definition at line 113 of file TargetPassConfig.h.
Referenced by addIRPasses(), addISelPrepare(), and setDisableVerify().
|
static |
Pseudo Pass IDs.
These are defined within TargetPassConfig because they are unregistered pass IDs. They are only useful for use with TargetPassConfig APIs to identify multiple occurrences of the same pass.EarlyTailDuplicate - A clone of the TailDuplicate pass that runs early during codegen, on SSA form.
Definition at line 89 of file TargetPassConfig.h.
Referenced by overridePass().
|
protected |
Default setting for -enable-tail-merge on this target.
Definition at line 116 of file TargetPassConfig.h.
Referenced by getEnableTailMerge(), and setEnableTailMerge().
|
static |
Definition at line 125 of file TargetPassConfig.h.
Referenced by isPassSubstitutedOrOverridden().
|
protected |
Definition at line 107 of file TargetPassConfig.h.
Referenced by addPass(), getPassSubstitution(), insertPass(), substitutePass(), TargetPassConfig(), and ~TargetPassConfig().
|
protected |
Definition at line 108 of file TargetPassConfig.h.
Referenced by addPass(), setInitialized(), and setOpt().
|
static |
PostRAMachineLICM - A clone of the LICM pass that runs during late machine optimization after regalloc.
Definition at line 93 of file TargetPassConfig.h.
Referenced by overridePass().
|
protected |
Definition at line 106 of file TargetPassConfig.h.
Referenced by addCodeGenPrepare(), addISelPrepare(), addMachineLateOptimization(), addMachinePasses(), addPassesToHandleExceptions(), addPrintPass(), getOptLevel(), getTM(), and TargetPassConfig().
1.8.6