diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-04 00:40:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-04 00:40:47 +0000 |
commit | a4479ad25f7f184fc4600beb1d39fd1e71849c4d (patch) | |
tree | 667da4f3c82ab89bb4ad3fdc6fa88eef36a52151 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | f9186596f06f2c1c5357420d44e2fe2f38f98068 (diff) |
invert to if's to make the logic simpler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index b33bc859c5..ac1c8dbd72 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -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; |