Index: include/llvm/Support/CodeGen.h =================================================================== --- include/llvm/Support/CodeGen.h +++ include/llvm/Support/CodeGen.h @@ -49,10 +49,10 @@ // Code generation optimization level. namespace CodeGenOpt { enum Level { - None, // -O0 - Less, // -O1 - Default, // -O2, -Os - Aggressive // -O3 + None=0, // -O0 + Less=1, // -O1 + Default=2, // -O2, -Os + Aggressive=3 // -O3 }; } Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -211,8 +211,8 @@ OptLevelChanger(SelectionDAGISel &ISel, CodeGenOpt::Level NewOptLevel) : IS(ISel) { SavedOptLevel = IS.OptLevel; - if (NewOptLevel == SavedOptLevel) - return; + //if (NewOptLevel == SavedOptLevel) + //return; IS.OptLevel = NewOptLevel; IS.TM.setOptLevel(NewOptLevel); LLVM_DEBUG(dbgs() << "\nChanging optimization level for Function " @@ -230,8 +230,8 @@ } ~OptLevelChanger() { - if (IS.OptLevel == SavedOptLevel) - return; + //if (IS.OptLevel == SavedOptLevel) + //return; LLVM_DEBUG(dbgs() << "\nRestoring optimization level for Function " << IS.MF->getFunction().getName() << "\n"); LLVM_DEBUG(dbgs() << "\tBefore: -O" << IS.OptLevel << " ; After: -O"