summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-07-24 20:48:54 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-07-24 20:48:54 +0000
commit3c8eb80d93d61628752cc94f7e1261118d6fd3b7 (patch)
tree1e7b22a907fd80f39017132ad3d91fec007610f3
parent14b69d59dd5f2dec92ed68738fe1fe8a4c6fc312 (diff)
downloadbcm5719-llvm-3c8eb80d93d61628752cc94f7e1261118d6fd3b7.tar.gz
bcm5719-llvm-3c8eb80d93d61628752cc94f7e1261118d6fd3b7.zip
Add hook to insert late LLVM=>LLVM passes just before isel
llvm-svn: 109354
-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 60c0064cecf..42e99e01564 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -312,10 +312,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 fd102416d89..98d49ad65af 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -307,6 +307,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