1 Add an llvm option to enable/disable running the global value numbering
2 optimization pass. Disabling this pass helps to minimize the size of
5 Introduced here: http://svnweb.freebsd.org/changeset/base/274968
7 Index: lib/Transforms/IPO/PassManagerBuilder.cpp
8 ===================================================================
9 --- lib/Transforms/IPO/PassManagerBuilder.cpp
10 +++ lib/Transforms/IPO/PassManagerBuilder.cpp
11 @@ -57,6 +57,10 @@ static cl::opt<bool> RunLoadCombine("combine-loads
13 cl::desc("Run the load combining pass"));
15 +static cl::opt<bool> RunGVN("enable-gvn", cl::init(true),
17 + cl::desc("Run the global value numbering pass"));
19 PassManagerBuilder::PassManagerBuilder() {
22 @@ -210,7 +214,8 @@ void PassManagerBuilder::populateModulePassManager
25 MPM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamond
26 - MPM.add(createGVNPass()); // Remove redundancies
28 + MPM.add(createGVNPass()); // Remove redundancies
30 MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
31 MPM.add(createSCCPPass()); // Constant prop with SCCP