38 cl::desc(
"Disable tail duplication"));
40 cl::desc(
"Disable pre-register allocation tail duplication"));
46 cl::desc(
"Disable Stack Slot Coloring"));
48 cl::desc(
"Disable Machine Dead Code Elimination"));
50 cl::desc(
"Disable Early If-conversion"));
54 cl::desc(
"Disable Machine Common Subexpression Elimination"));
57 cl::desc(
"Enable optimized register allocation compilation path."));
60 cl::desc(
"Enable the machine instruction scheduling pass."));
65 cl::desc(
"Disable Machine Sinking"));
67 cl::desc(
"Disable Loop Strength Reduction Pass"));
69 cl::desc(
"Disable Codegen Prepare"));
71 cl::desc(
"Disable Copy Propagation pass"));
73 cl::desc(
"Print LLVM IR produced by the loop-reduce pass"));
75 cl::desc(
"Print LLVM IR input to isel pass"));
77 cl::desc(
"Dump garbage collector data"));
79 cl::desc(
"Verify generated machine code"),
88 cl::desc(
"Run live interval analysis earlier in the pipeline"));
187 "Target Pass Configuration",
false,
false)
222 DisableVerify(
false),
223 EnableTailMerge(
true) {
245 TargetPassID != InsertedPassID.
getID()) ||
248 "Insert a pass after itself!");
249 std::pair<AnalysisID, IdentifyingPassPtr>
P(TargetPassID, InsertedPassID);
299 if (Started && !Stopped)
303 if (StopAfter == PassID)
305 if (StartAfter == PassID)
307 if (Stopped && !Started)
334 for (
SmallVectorImpl<std::pair<AnalysisID, IdentifyingPassPtr> >::iterator
337 if ((*I).first == PassID) {
338 assert((*I).second.isValid() &&
"Illegal Pass ID!");
340 if ((*I).second.isInstance())
341 NP = (*I).second.getInstance();
344 assert(NP &&
"Pass ID not registered");
431 "*** Final LLVM Code input to ISel ***\n",
464 .equals(
"option-unspecified")) {
468 assert (TPI && IPI &&
"Pass ID not registered!");
469 const char *TID = (
const char *)(TPI->
getTypeInfo());
470 const char *IID = (
const char *)(IPI->
getTypeInfo());
602 "pick register allocator based on -O option",
610 cl::desc(
"Register allocator to use"));
714 printAndVerify(
"After StackSlotColoring and postra Machine LICM");
static cl::opt< cl::boolOrDefault > OptimizeRegAlloc("optimize-regalloc", cl::Hidden, cl::desc("Enable optimized register allocation compilation path."))
unsigned PrintMachineCode
static PassRegistry * getPassRegistry()
Pass * createLoopStrengthReducePass()
AnalysisID addPass(AnalysisID PassID)
virtual void addIRPasses()
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
char & MachineLICMID
MachineLICM - This pass performs LICM on machine instructions.
virtual bool addPreRewrite()
FunctionPass * createDwarfEHPass(const TargetMachine *TM)
static cl::opt< cl::boolOrDefault > EnableMachineSched("enable-misched", cl::Hidden, cl::desc("Enable the machine instruction scheduling pass."))
char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
char & EarlyIfConverterID
FunctionPass *(* FunctionPassCtor)()
static void setDefault(FunctionPassCtor C)
const void * getTypeInfo() const
ExceptionHandling::ExceptionsType getExceptionHandlingType() const
char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
static MachinePassRegistry Registry
RegisterRegAlloc's global Registry tracks allocator registration.
static IdentifyingPassPtr applyOverride(IdentifyingPassPtr TargetID, cl::boolOrDefault Override, AnalysisID StandardID)
char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
virtual void addMachineSSAOptimization()
Add passes that optimize machine instructions in SSA form.
char & MachineBlockPlacementStatsID
virtual bool addPostRegAlloc()
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM)
static cl::opt< bool > DisableLSR("disable-lsr", cl::Hidden, cl::desc("Disable Loop Strength Reduction Pass"))
static cl::opt< bool > DisableEarlyTailDup("disable-early-taildup", cl::Hidden, cl::desc("Disable pre-register allocation tail duplication"))
Pass * getInstance() const
void insertPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID)
Insert InsertedPassID pass after TargetPassID pass.
FunctionPass * createCodeGenPreparePass(const TargetMachine *TM=0)
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
const MCAsmInfo * getMCAsmInfo() const
FunctionPass * createGCLoweringPass()
#define llvm_unreachable(msg)
bool getOptimizeRegAlloc() const
Return true if the optimized regalloc pipeline is enabled.
static cl::opt< bool > DisableBlockPlacement("disable-block-placement", cl::Hidden, cl::desc("Disable probability-driven block placement"))
static RegisterRegAlloc defaultRegAlloc("default","pick register allocator based on -O option", useDefaultRegisterAllocator)
FunctionPass * createRegAllocPass(bool Optimized)
ID
LLVM Calling Convention Representation.
static IdentifyingPassPtr overridePass(AnalysisID StandardID, IdentifyingPassPtr TargetID)
CodeGenOpt::Level getOptLevel() const
virtual void addMachinePasses()
IdentifyingPassPtr getPassSubstitution(AnalysisID StandardID) const
char & MachineCSEID
MachineCSE - This pass performs global CSE on machine instructions.
static cl::opt< bool > EnableBlockPlacementStats("enable-block-placement-stats", cl::Hidden, cl::desc("Collect probability-driven block placement stats"))
char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
char & ExpandPostRAPseudosID
ImmutablePass * createBasicAliasAnalysisPass()
char & ExpandISelPseudosID
ExpandISelPseudos - This pass expands pseudo-instructions.
char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID)
FunctionPass * createUnreachableBlockEliminationPass()
virtual bool addILPOpts()
FunctionPass * createGCInfoPrinter(raw_ostream &OS)
static cl::opt< bool > DisablePostRA("disable-post-ra", cl::Hidden, cl::desc("Disable Post Regalloc"))
DenseMap< AnalysisID, IdentifyingPassPtr > TargetPasses
virtual FunctionPass * createTargetRegisterAllocator(bool Optimized)
virtual bool addGCPasses()
Add standard GC passes.
initializer< Ty > init(const Ty &Val)
ImmutablePass * createTypeBasedAliasAnalysisPass()
* if(!EatIfPresent(lltok::kw_thread_local)) return false
static char PostRAMachineLICMID
void disablePass(AnalysisID PassID)
Allow the target to disable a specific standard pass by default.
virtual void addOptimizedRegAlloc(FunctionPass *RegAllocPass)
virtual void addMachineLateOptimization()
Add passes that optimize machine instructions after register allocation.
virtual bool addPreISel()
FunctionPass * createPrintFunctionPass(const std::string &Banner, raw_ostream *OS, bool DeleteStream=false)
FunctionPass * createLowerInvokePass(const TargetMachine *TM=0, bool useExpensiveEHSupport=false)
virtual void addISelPrepare()
virtual void addCodeGenPrepare()
static FunctionPass * useDefaultRegisterAllocator()
static cl::opt< RegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< RegisterRegAlloc > > RegAlloc("regalloc", cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use"))
-regalloc=... command line option.
static cl::opt< bool > DisableEarlyIfConversion("disable-early-ifcvt", cl::Hidden, cl::desc("Disable Early If-conversion"))
char & MachineCopyPropagationID
static cl::opt< bool > DisablePostRAMachineLICM("disable-postra-machine-licm", cl::Hidden, cl::desc("Disable Machine LICM"))
void addPassesToHandleExceptions()
Add passes to lower exception handling for the code generator.
FunctionPass * createSjLjEHPreparePass(const TargetMachine *TM)
static cl::opt< bool > PrintLSR("print-lsr-output", cl::Hidden, cl::desc("Print LLVM IR produced by the loop-reduce pass"))
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static FunctionPassCtor getDefault()
FunctionPass * createStackProtectorPass(const TargetMachine *TM)
const STC & getSubtarget() const
static cl::opt< bool > DisableBranchFold("disable-branch-fold", cl::Hidden, cl::desc("Disable branch folding"))
char & MachineSinkingID
MachineSinking - This pass performs sinking on machine instructions.
static cl::opt< bool > DisableSSC("disable-ssc", cl::Hidden, cl::desc("Disable Stack Slot Coloring"))
FunctionPass * createMachineVerifierPass(const char *Banner=0)
void printAndVerify(const char *Banner)
MachineFunctionPass * createMachineFunctionPrinterPass(raw_ostream &OS, const std::string &Banner="")
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
virtual bool addPreSched2()
char & PeepholeOptimizerID
virtual void addFastRegAlloc(FunctionPass *RegAllocPass)
char & PrologEpilogCodeInserterID
char & GCMachineCodeAnalysisID
virtual bool addPreRegAlloc()
static IdentifyingPassPtr applyDisable(IdentifyingPassPtr PassID, bool Override)
static cl::opt< bool > VerifyMachineCode("verify-machineinstrs", cl::Hidden, cl::desc("Verify generated machine code"), cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL))
static cl::opt< bool > EarlyLiveIntervals("early-live-intervals", cl::Hidden, cl::desc("Run live interval analysis earlier in the pipeline"))
virtual void addBlockPlacement()
Add standard basic block placement passes.
static cl::opt< bool > DisableCopyProp("disable-copyprop", cl::Hidden, cl::desc("Disable Copy Propagation pass"))
FunctionPass * createGreedyRegisterAllocator()
char & MachineBlockPlacementID
static cl::opt< bool > DisableMachineSink("disable-machine-sink", cl::Hidden, cl::desc("Disable Machine Sinking"))
static cl::opt< bool > PrintISelInput("print-isel-input", cl::Hidden, cl::desc("Print LLVM IR input to isel pass"))
cl::opt< std::string > StopAfter("stop-after", cl::desc("Stop compilation after a specific pass"), cl::value_desc("pass-name"), cl::init(""))
virtual bool addPreEmitPass()
cl::opt< std::string > StartAfter("start-after", cl::desc("Resume compilation after a specific pass"), cl::value_desc("pass-name"), cl::init(""))
void setOpt(bool &Opt, bool Val)
static cl::opt< std::string > PrintMachineInstrs("print-machineinstrs", cl::ValueOptional, cl::desc("Print machine instrs"), cl::value_desc("pass-name"), cl::init("option-unspecified"))
static cl::opt< bool > PrintGCInfo("print-gc", cl::Hidden, cl::desc("Dump garbage collector data"))
bool shouldPrintMachineCode() const
static cl::opt< bool > DisableMachineCSE("disable-machine-cse", cl::Hidden, cl::desc("Disable Machine Common Subexpression Elimination"))
const PassInfo * getPassInfo(const void *TI) const
char & TwoAddressInstructionPassID
static cl::opt< bool > DisableMachineDCE("disable-machine-dce", cl::Hidden, cl::desc("Disable Machine Dead Code Elimination"))
SmallVector< std::pair< AnalysisID, IdentifyingPassPtr >, 4 > InsertedPasses
static char EarlyTailDuplicateID
static Pass * createPass(AnalysisID ID)
void initializeCodeGen(PassRegistry &)
initializeCodeGen - Initialize all passes linked into the CodeGen library.
FunctionPass * createFastRegisterAllocator()
virtual ~TargetPassConfig()
char & BranchFolderPassID
static cl::opt< bool > DisableMachineLICM("disable-machine-licm", cl::Hidden, cl::desc("Disable Machine LICM"))
static cl::opt< bool > DisableTailDuplicate("disable-tail-duplicate", cl::Hidden, cl::desc("Disable tail duplication"))
static cl::opt< bool > DisableCGP("disable-cgp", cl::Hidden, cl::desc("Disable Codegen Prepare"))
bool useMachineScheduler() const
Temporary API to test migration to MI scheduler.
char & LocalStackSlotAllocationID
char *getenv(const char *name);
FunctionPass * createVerifierPass(VerifierFailureAction action=AbortProcessAction)
Create a verifier pass.