1 Pull in r222562 from upstream llvm trunk (by Roman Divacky):
3 Disable header duplication at -Oz in loop-rotate pass.
5 This helps to minimize the size of boot2.
7 Introduced here: http://svnweb.freebsd.org/changeset/base/274968
9 Index: lib/Transforms/IPO/PassManagerBuilder.cpp
10 ===================================================================
11 --- lib/Transforms/IPO/PassManagerBuilder.cpp
12 +++ lib/Transforms/IPO/PassManagerBuilder.cpp
13 @@ -195,7 +195,8 @@ void PassManagerBuilder::populateModulePassManager
14 MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
15 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
16 MPM.add(createReassociatePass()); // Reassociate expressions
17 - MPM.add(createLoopRotatePass()); // Rotate Loop
18 + // Rotate Loop - disable header duplication at -Oz
19 + MPM.add(createLoopRotatePass(SizeLevel == 2 ? 0 : -1));
20 MPM.add(createLICMPass()); // Hoist loop invariants
21 MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3));
22 MPM.add(createInstructionCombiningPass());