summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-04-07 18:18:42 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-04-07 18:18:42 +0000
commitfed8ee7dfc5c3f67f11e6486f3ef864d29f5dd0a (patch)
treeacfb1edef9b0df80195260f51c446f5ef2d1089e /llvm
parent6855d62768afbc498a21f54e7415a87485eb5f3f (diff)
downloadbcm5719-llvm-fed8ee7dfc5c3f67f11e6486f3ef864d29f5dd0a.tar.gz
bcm5719-llvm-fed8ee7dfc5c3f67f11e6486f3ef864d29f5dd0a.zip
Add hook to insert late LLVM=>LLVM passes just before isel
llvm-svn: 100640
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Target/TargetMachine.h13
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp2
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index d1d665f870f..2f29de55be2 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -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;
}
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index ced6664c4a3..714ad73e790 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -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",
OpenPOWER on IntegriCloud