Disable most IR-level transform passes on functions marked 'optnone'.
[oota-llvm.git] / lib / Transforms / Scalar / LoopUnswitch.cpp
index 32c6412ef757b7b9a8cf72d9d90d942b0f766c42..cfadf9a9d4abcc3312de1c6d6f03385bdc98b060 100644 (file)
@@ -382,6 +382,9 @@ static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) {
 }
 
 bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {
+  if (skipOptnoneFunction(L))
+    return false;
+
   LI = &getAnalysis<LoopInfo>();
   LPM = &LPM_Ref;
   DominatorTreeWrapperPass *DTWP =