aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolution.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolution.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 00b95c9..7bfd0ce 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -54,6 +54,10 @@ namespace llvm {
/// The ScalarEvolution's BumpPtrAllocator holds the data.
FoldingSetNodeIDRef FastID;
+ /// AllocationSequenceNumber - This is used as a deterministic tie
+ /// breaker when sorting SCEVs.
+ unsigned AllocationSequenceNumber;
+
// The SCEV baseclass this node corresponds to
const unsigned short SCEVType;
@@ -68,11 +72,18 @@ namespace llvm {
protected:
virtual ~SCEV();
public:
- explicit SCEV(const FoldingSetNodeIDRef ID, unsigned SCEVTy) :
- FastID(ID), SCEVType(SCEVTy), SubclassData(0) {}
+ explicit SCEV(const FoldingSetNodeIDRef ID, unsigned num, unsigned SCEVTy) :
+ FastID(ID), AllocationSequenceNumber(num),
+ SCEVType(SCEVTy), SubclassData(0) {}
unsigned getSCEVType() const { return SCEVType; }
+ /// getAllocationSequenceNumber - Return an arbitrary value which can be
+ /// used to deterministically order a sequence of SCEVs.
+ unsigned getAllocationSequenceNumber() const {
+ return AllocationSequenceNumber;
+ }
+
/// Profile - FoldingSet support.
void Profile(FoldingSetNodeID& ID) { ID = FastID; }
@@ -663,6 +674,7 @@ namespace llvm {
private:
FoldingSet<SCEV> UniqueSCEVs;
BumpPtrAllocator SCEVAllocator;
+ unsigned CurAllocationSequenceNumber;
};
}