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
|
2015-01-25 23:36:55 +00:00
|
|
|
@@ -78,6 +78,10 @@ static cl::opt<bool>
|
|
|
|
EnableMLSM("mlsm", cl::init(true), cl::Hidden,
|
|
|
|
cl::desc("Enable motion of merged load and store"));
|
2014-11-24 18:43:37 +00:00
|
|
|
|
2015-01-25 23:36:55 +00:00
|
|
|
+static cl::opt<bool> EnableGVN("enable-gvn",
|
|
|
|
+ cl::init(true), cl::Hidden,
|
|
|
|
+ cl::desc("Run the global value numbering pass"));
|
2014-11-24 18:43:37 +00:00
|
|
|
+
|
|
|
|
PassManagerBuilder::PassManagerBuilder() {
|
|
|
|
OptLevel = 2;
|
|
|
|
SizeLevel = 0;
|
2015-01-25 23:36:55 +00:00
|
|
|
@@ -244,7 +248,8 @@ void PassManagerBuilder::populateModulePassManager
|
2014-11-24 18:43:37 +00:00
|
|
|
if (OptLevel > 1) {
|
2015-01-25 23:36:55 +00:00
|
|
|
if (EnableMLSM)
|
|
|
|
MPM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds
|
|
|
|
- MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies
|
|
|
|
+ if (EnableGVN)
|
|
|
|
+ MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies
|
2014-11-24 18:43:37 +00:00
|
|
|
}
|
|
|
|
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
|
|
|
|
MPM.add(createSCCPPass()); // Constant prop with SCCP
|