Rather than having llvm-gcc changing the meaning of OptimizeSize, just make sure...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 30 Oct 2009 07:23:49 +0000 (07:23 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 30 Oct 2009 07:23:49 +0000 (07:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85581 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/StandardPasses.h

index 611e786448246c24a42e01471f3b0e9360e2e940..e36f83d43fe7d3af3af535d544a94d0af9ffe18b 100644 (file)
@@ -128,7 +128,7 @@ namespace llvm {
     PM->add(createReassociatePass());           // Reassociate expressions
     PM->add(createLoopRotatePass());            // Rotate Loop
     PM->add(createLICMPass());                  // Hoist loop invariants
-    PM->add(createLoopUnswitchPass(OptimizeSize));
+    PM->add(createLoopUnswitchPass(OptimizeSize || OptimizationLevel < 3));
     PM->add(createInstructionCombiningPass());  
     PM->add(createIndVarSimplifyPass());        // Canonicalize indvars
     PM->add(createLoopDeletionPass());          // Delete dead loops