aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-11-12 07:35:05 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-11-12 07:35:05 +0000
commit586f69a11881d828c056ce017b3fb432341d9657 (patch)
treecaf876c0d7890ff0b865674caac6d2118ff94046 /include
parentb9d2c03d200bea99470766b0fb53dd07e11b086a (diff)
downloadexternal_llvm-586f69a11881d828c056ce017b3fb432341d9657.zip
external_llvm-586f69a11881d828c056ce017b3fb432341d9657.tar.gz
external_llvm-586f69a11881d828c056ce017b3fb432341d9657.tar.bz2
- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
cannot be folded into target cmp instruction. - Avoid a phase ordering issue where early cmp optimization would prevent the later count-to-zero optimization. - Add missing checks which could cause LSR to reuse stride that does not have users. - Fix a bug in count-to-zero optimization code which failed to find the pre-inc iv's phi node. - Remove, tighten, loosen some incorrect checks disable valid transformations. - Quite a bit of code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/IVUsers.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h
index 948c675..22fbb35 100644
--- a/include/llvm/Analysis/IVUsers.h
+++ b/include/llvm/Analysis/IVUsers.h
@@ -161,6 +161,10 @@ public:
void addUser(const SCEV *Offset, Instruction *User, Value *Operand) {
Users.push_back(new IVStrideUse(this, Offset, User, Operand));
}
+
+ void removeUser(IVStrideUse *User) {
+ Users.erase(User);
+ }
};
class IVUsers : public LoopPass {
@@ -201,6 +205,9 @@ public:
/// return true. Otherwise, return false.
bool AddUsersIfInteresting(Instruction *I);
+ void AddUser(const SCEV *Stride, const SCEV *Offset,
+ Instruction *User, Value *Operand);
+
/// getReplacementExpr - Return a SCEV expression which computes the
/// value of the OperandValToReplace of the given IVStrideUse.
const SCEV *getReplacementExpr(const IVStrideUse &U) const;