Reapply 105540, 105542, and 105548, and revert r105732.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-06-18 19:26:04 +00:00
parent dd76f18f90
commit 78db186d2d
4 changed files with 77 additions and 164 deletions

View File

@@ -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;
};
}