summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-29 16:40:03 +0000
committerDan Gohman <gohman@apple.com>2010-08-29 16:40:03 +0000
commiteaa40ff74e41176250bd6b50116ab03b0c596d5e (patch)
tree3dee52c79380d146bc77be24c5d2bf31f72a5aad /include/llvm
parent4f7e18dee35c55e4e719f5fb73726ab035a7e5db (diff)
downloadllvm-eaa40ff74e41176250bd6b50116ab03b0c596d5e.tar.gz
llvm-eaa40ff74e41176250bd6b50116ab03b0c596d5e.tar.bz2
llvm-eaa40ff74e41176250bd6b50116ab03b0c596d5e.tar.xz
Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of IVUser's results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/IVUsers.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h
index 578e6aba83..7aa34f1cff 100644
--- a/include/llvm/Analysis/IVUsers.h
+++ b/include/llvm/Analysis/IVUsers.h
@@ -27,6 +27,7 @@ class Value;
class IVUsers;
class ScalarEvolution;
class SCEV;
+class SCEVAddRecExpr;
class IVUsers;
/// IVStrideUse - Keep track of one use of a strided induction variable.
@@ -122,7 +123,7 @@ class IVUsers : public LoopPass {
LoopInfo *LI;
DominatorTree *DT;
ScalarEvolution *SE;
- SmallPtrSet<Instruction*,16> Processed;
+ SmallPtrSet<Instruction *, 16> Processed;
/// IVUses - A list of all tracked IV uses of induction variable expressions
/// we are interested in.
@@ -134,14 +135,16 @@ class IVUsers : public LoopPass {
virtual void releaseMemory();
+ const SCEVAddRecExpr *findInterestingAddRec(const SCEV *S) const;
+ bool isInterestingUser(const Instruction *User) const;
+
public:
static char ID; // Pass ID, replacement for typeid
IVUsers();
- /// AddUsersIfInteresting - Inspect the specified Instruction. If it is a
- /// reducible SCEV, recursively add its users to the IVUsesByStride set and
- /// return true. Otherwise, return false.
- bool AddUsersIfInteresting(Instruction *I);
+ /// AddUsersIfInteresting - Inspect the def-use graph starting at the
+ /// specified Instruction and add IVUsers.
+ void AddUsersIfInteresting(Instruction *I);
IVStrideUse &AddUser(Instruction *User, Value *Operand);