use continue to reduce indentation
authorChris Lattner <sabre@nondot.org>
Thu, 27 Nov 2008 23:00:20 +0000 (23:00 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 27 Nov 2008 23:00:20 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 9052d6088e35349edd559c82e06905f1d99bd7f6..c2f3209f05953adac18b4f9ab25e4e6dd506910b 100644 (file)
@@ -2076,25 +2076,26 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) {
       //
       // FIXME: this needs to eliminate an induction variable even if it's being
       // compared against some value to decide loop termination.
-      if (PN->hasOneUse()) {
-        SmallPtrSet<PHINode *, 2> PHIs;
-        for (Instruction *J = dyn_cast<Instruction>(*PN->use_begin());
-             J && J->hasOneUse() && !J->mayWriteToMemory();
-             J = dyn_cast<Instruction>(*J->use_begin())) {
-          // If we find the original PHI, we've discovered a cycle.
-          if (J == PN) {
-            // Break the cycle and mark the PHI for deletion.
-            SE->deleteValueFromRecords(PN);
-            PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
-            DeadInsts.insert(PN);
-            Changed = true;
-            break;
-          }
-          // If we find a PHI more than once, we're on a cycle that
-          // won't prove fruitful.
-          if (isa<PHINode>(J) && !PHIs.insert(cast<PHINode>(J)))
-            break;
+      if (!PN->hasOneUse())
+        continue;
+      
+      SmallPtrSet<PHINode *, 4> PHIs;
+      for (Instruction *J = dyn_cast<Instruction>(*PN->use_begin());
+           J && J->hasOneUse() && !J->mayWriteToMemory();
+           J = dyn_cast<Instruction>(*J->use_begin())) {
+        // If we find the original PHI, we've discovered a cycle.
+        if (J == PN) {
+          // Break the cycle and mark the PHI for deletion.
+          SE->deleteValueFromRecords(PN);
+          PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
+          DeadInsts.insert(PN);
+          Changed = true;
+          break;
         }
+        // If we find a PHI more than once, we're on a cycle that
+        // won't prove fruitful.
+        if (isa<PHINode>(J) && !PHIs.insert(cast<PHINode>(J)))
+          break;
       }
     }
     DeleteTriviallyDeadInstructions(DeadInsts);