[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Aug 3 17:40:58 PDT 2005
Changes in directory llvm/lib/Transforms/Scalar:
LoopStrengthReduce.cpp updated: 1.28 -> 1.29
---
Log message:
invert to if's to make the logic simpler
---
Diffs of the changes: (+12 -15)
LoopStrengthReduce.cpp | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.28 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.29
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.28 Wed Aug 3 19:14:11 2005
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Aug 3 19:40:47 2005
@@ -405,21 +405,18 @@
}
// 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");
-
- // 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);
- }
+ 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);
}
}
return true;
More information about the llvm-commits
mailing list