summaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/IVUsers.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-06-12 15:42:51 +0000
committerdim <dim@FreeBSD.org>2011-06-12 15:42:51 +0000
commitece02cd5829cea836e9365b0845a8ef042d17b0a (patch)
treeb3032e51d630e8070e9e08d6641648f195316a80 /include/llvm/Analysis/IVUsers.h
parent2b066988909948dc3d53d01760bc2d71d32f3feb (diff)
downloadFreeBSD-src-ece02cd5829cea836e9365b0845a8ef042d17b0a.zip
FreeBSD-src-ece02cd5829cea836e9365b0845a8ef042d17b0a.tar.gz
Vendor import of llvm trunk r132879:
http://llvm.org/svn/llvm-project/llvm/trunk@132879
Diffstat (limited to 'include/llvm/Analysis/IVUsers.h')
-rw-r--r--include/llvm/Analysis/IVUsers.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h
index e56d24d..1b78fe4 100644
--- a/include/llvm/Analysis/IVUsers.h
+++ b/include/llvm/Analysis/IVUsers.h
@@ -37,8 +37,8 @@ class TargetData;
class IVStrideUse : public CallbackVH, public ilist_node<IVStrideUse> {
friend class IVUsers;
public:
- IVStrideUse(IVUsers *P, Instruction* U, Value *O)
- : CallbackVH(U), Parent(P), OperandValToReplace(O) {
+ IVStrideUse(IVUsers *P, Instruction* U, Value *O, Value *PN)
+ : CallbackVH(U), Parent(P), OperandValToReplace(O), Phi(PN) {
}
/// getUser - Return the user instruction for this use.
@@ -51,6 +51,11 @@ public:
setValPtr(NewUser);
}
+ /// getPhi - Return the phi node that represents this IV.
+ PHINode *getPhi() const {
+ return cast<PHINode>(Phi);
+ }
+
/// getOperandValToReplace - Return the Value of the operand in the user
/// instruction that this IVStrideUse is representing.
Value *getOperandValToReplace() const {
@@ -81,6 +86,9 @@ private:
/// that this IVStrideUse is representing.
WeakVH OperandValToReplace;
+ /// Phi - The loop header phi that represents this IV.
+ WeakVH Phi;
+
/// PostIncLoops - The set of loops for which Expr has been adjusted to
/// use post-inc mode. This corresponds with SCEVExpander's post-inc concept.
PostIncLoopSet PostIncLoops;
@@ -143,9 +151,9 @@ public:
/// 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);
+ bool AddUsersIfInteresting(Instruction *I, PHINode *Phi);
- IVStrideUse &AddUser(Instruction *User, Value *Operand);
+ IVStrideUse &AddUser(Instruction *User, Value *Operand, PHINode *Phi);
/// getReplacementExpr - Return a SCEV expression which computes the
/// value of the OperandValToReplace of the given IVStrideUse.
OpenPOWER on IntegriCloud