aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff')
-rw-r--r--contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff b/contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff
new file mode 100644
index 000000000000..bc09f273bb1b
--- /dev/null
+++ b/contrib/llvm/patches/patch-10-llvm-r222562-loop-rotate.diff
@@ -0,0 +1,22 @@
+Pull in r222562 from upstream llvm trunk (by Roman Divacky):
+
+ Disable header duplication at -Oz in loop-rotate pass.
+
+This helps to minimize the size of boot2.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/274968
+
+Index: lib/Transforms/IPO/PassManagerBuilder.cpp
+===================================================================
+--- lib/Transforms/IPO/PassManagerBuilder.cpp
++++ lib/Transforms/IPO/PassManagerBuilder.cpp
+@@ -195,7 +195,8 @@ void PassManagerBuilder::populateModulePassManager
+ MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
+ MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
+ MPM.add(createReassociatePass()); // Reassociate expressions
+- MPM.add(createLoopRotatePass()); // Rotate Loop
++ // Rotate Loop - disable header duplication at -Oz
++ MPM.add(createLoopRotatePass(SizeLevel == 2 ? 0 : -1));
+ MPM.add(createLICMPass()); // Hoist loop invariants
+ MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3));
+ MPM.add(createInstructionCombiningPass());