Add hook to insert late LLVM=>LLVM passes just before isel

llvm-svn: 100640
This commit is contained in:
Anton Korobeynikov 2010-04-07 18:18:42 +00:00
parent 6855d62768
commit fed8ee7dfc
2 changed files with 11 additions and 4 deletions

View File

@ -264,10 +264,15 @@ public:
bool DisableVerify = true);
/// Target-Independent Code Generator Pass Configuration Options.
/// addInstSelector - This method should add any "last minute" LLVM->LLVM
/// passes, then install an instruction selector pass, which converts from
/// LLVM code to machine instructions.
/// addPreISelPasses - This method should add any "last minute" LLVM->LLVM
/// passes (which are run just before instruction selector).
virtual bool addPreISel(PassManagerBase &, CodeGenOpt::Level) {
return true;
}
/// addInstSelector - This method should install an instruction selector pass,
/// which converts from LLVM code to machine instructions.
virtual bool addInstSelector(PassManagerBase &, CodeGenOpt::Level) {
return true;
}

View File

@ -268,6 +268,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
PM.add(createStackProtectorPass(getTargetLowering()));
addPreISel(PM, OptLevel);
if (PrintISelInput)
PM.add(createPrintFunctionPass("\n\n"
"*** Final LLVM Code input to ISel ***\n",