2014-11-24 18:43:37 +00:00
|
|
|
Add an llvm option to enable/disable running the global value numbering
|
|
|
|
optimization pass. Disabling this pass helps to minimize the size of
|
|
|
|
boot2.
|
|
|
|
|
|
|
|
Introduced here: http://svnweb.freebsd.org/changeset/base/274968
|
|
|
|
|
|
|
|
Index: lib/Transforms/IPO/PassManagerBuilder.cpp
|
|
|
|
===================================================================
|
2014-11-29 20:23:18 +00:00
|
|
|
--- lib/Transforms/IPO/PassManagerBuilder.cpp
|
|
|
|
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
|
2014-11-24 18:43:37 +00:00
|
|
|
@@ -57,6 +57,10 @@ static cl::opt<bool> RunLoadCombine("combine-loads
|
|
|
|
cl::Hidden,
|
|
|
|
cl::desc("Run the load combining pass"));
|
|
|
|
|
|
|
|
+static cl::opt<bool> RunGVN("enable-gvn", cl::init(true),
|
|
|
|
+ cl::Hidden,
|
|
|
|
+ cl::desc("Run the global value numbering pass"));
|
|
|
|
+
|
|
|
|
PassManagerBuilder::PassManagerBuilder() {
|
|
|
|
OptLevel = 2;
|
|
|
|
SizeLevel = 0;
|
|
|
|
@@ -210,7 +214,8 @@ void PassManagerBuilder::populateModulePassManager
|
|
|
|
|
|
|
|
if (OptLevel > 1) {
|
|
|
|
MPM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamond
|
|
|
|
- MPM.add(createGVNPass()); // Remove redundancies
|
|
|
|
+ if (RunGVN)
|
|
|
|
+ MPM.add(createGVNPass()); // Remove redundancies
|
|
|
|
}
|
|
|
|
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
|
|
|
|
MPM.add(createSCCPPass()); // Constant prop with SCCP
|