[llvm-commits] add EP_OptimizerLast
Kostya Serebryany
kcc at google.com
Fri Mar 23 14:11:10 PDT 2012
Hello,
Please review the following patch that adds extension point
"EP_OptimizerLast" to PassManagerBuilder.
Currently, ThreadSanitizer instrumentation pass (which is a FunctionPass,
not a ModulePass) runs as EP_ScalarOptimizerLate.
As the result it instruments functions before inlining, which is wrong.
Once this patch is in, I'll change ThreadSanitizer to run
at EP_OptimizerLast, so that it kicks in after inlining (really last).
An alternative to this change would be to make ThreadSanitizer a ModulePass
(kind of sad).
Thanks,
--kcc
Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp (revision 153188)
+++ lib/Transforms/IPO/PassManagerBuilder.cpp (working copy)
@@ -202,6 +202,7 @@
if (OptLevel > 1)
MPM.add(createConstantMergePass()); // Merge dup global constants
}
+ addExtensionsToPM(EP_OptimizerLast, MPM);
}
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
Index: include/llvm/Transforms/IPO/PassManagerBuilder.h
===================================================================
--- include/llvm/Transforms/IPO/PassManagerBuilder.h (revision 153188)
+++ include/llvm/Transforms/IPO/PassManagerBuilder.h (working copy)
@@ -73,6 +73,10 @@
/// cleanup-ish optimizations.
EP_ScalarOptimizerLate,
+ /// EP_OptimizerLast -- This extension point allows adding passes that
+ /// run after everything else.
+ EP_OptimizerLast,
+
/// EP_EnabledOnOptLevel0 - This extension point allows adding passes
that
/// should not be disabled by O0 optimization level. The passes will be
/// inserted after the inlining pass.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120323/6fd7d54b/attachment.html>
More information about the llvm-commits
mailing list