invert to if's to make the logic simpler
authorChris Lattner <sabre@nondot.org>
Thu, 4 Aug 2005 00:40:47 +0000 (00:40 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 4 Aug 2005 00:40:47 +0000 (00:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index b33bc859c5fd86e3f35382460849c0f25f68caec..ac1c8dbd72e3bb1c2102e56abac3991da10b9756 100644 (file)
@@ -405,21 +405,18 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L) {
     }
 
     // Next, see if this user is analyzable itself!
-    if (!AddUsersIfInteresting(User, L)) {
-      if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
-        // If this is a getelementptr instruction, figure out what linear
-        // expression of induction variable is actually being used.
-        //
-        if (AnalyzedGEPs.insert(GEP).second)   // Not already analyzed?
-          AnalyzeGetElementPtrUsers(GEP, I, L);
-      } else {
-        DEBUG(std::cerr << "FOUND USER: " << *User
-              << "   OF SCEV: " << *ISE << "\n");
+    if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
+      // If this is a getelementptr instruction, figure out what linear
+      // expression of induction variable is actually being used.
+      if (AnalyzedGEPs.insert(GEP).second)   // Not already analyzed?
+        AnalyzeGetElementPtrUsers(GEP, I, L);
+    } else if (!AddUsersIfInteresting(User, L)) {
+      DEBUG(std::cerr << "FOUND USER: " << *User
+            << "   OF SCEV: " << *ISE << "\n");
 
-        // Okay, we found a user that we cannot reduce.  Analyze the instruction
-        // and decide what to do with it.
-        IVUsesByStride[Step].addUser(Start, User, I);
-      }
+      // Okay, we found a user that we cannot reduce.  Analyze the instruction
+      // and decide what to do with it.
+      IVUsesByStride[Step].addUser(Start, User, I);
     }
   }
   return true;