[llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Feb 26 16:12:01 PST 2003
Changes in directory llvm/include/llvm/Analysis:
AliasSetTracker.h updated: 1.2 -> 1.3
---
Log message:
Make the aliassettracker much more precise by actually tracking size
information for various accesses. What a concept.
---
Diffs of the changes:
Index: llvm/include/llvm/Analysis/AliasSetTracker.h
diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.2 llvm/include/llvm/Analysis/AliasSetTracker.h:1.3
--- llvm/include/llvm/Analysis/AliasSetTracker.h:1.2 Mon Feb 24 14:37:52 2003
+++ llvm/include/llvm/Analysis/AliasSetTracker.h Wed Feb 26 16:10:55 2003
@@ -29,12 +29,19 @@
class PointerRec {
HashNodePair *NextInList;
AliasSet *AS;
+ unsigned Size;
public:
- PointerRec() : NextInList(0), AS(0) {}
+ PointerRec() : NextInList(0), AS(0), Size(0) {}
HashNodePair *getNext() const { return NextInList; }
bool hasAliasSet() const { return AS != 0; }
+ void updateSize(unsigned NewSize) {
+ if (NewSize > Size) Size = NewSize;
+ }
+
+ unsigned getSize() const { return Size; }
+
AliasSet *getAliasSet(AliasSetTracker &AST) {
assert(AS && "No AliasSet yet!");
if (AS->Forward) {
@@ -87,7 +94,7 @@
unsigned AliasTy : 1;
/// Define an iterator for alias sets... this is just a forward iterator.
- class iterator : public forward_iterator<Value*, ptrdiff_t> {
+ class iterator : public forward_iterator<HashNodePair, ptrdiff_t> {
HashNodePair *CurNode;
public:
iterator(HashNodePair *CN = 0) : CurNode(CN) {}
@@ -102,11 +109,11 @@
return *this;
}
- value_type operator*() const {
+ value_type &operator*() const {
assert(CurNode && "Dereferencing AliasSet.end()!");
- return CurNode->first;
+ return *CurNode;
}
- value_type operator->() const { return operator*(); }
+ value_type *operator->() const { return &operator*(); }
iterator& operator++() { // Preincrement
assert(CurNode && "Advancing past AliasSet.end()!");
@@ -148,8 +155,8 @@
AliasSet() : PtrListHead(0), PtrListTail(0), Forward(0), RefCount(0),
AccessTy(NoModRef), AliasTy(MustAlias) {
}
- Value *getSomePointer() const {
- return PtrListHead ? PtrListHead->first : 0;
+ HashNodePair *getSomePointer() const {
+ return PtrListHead ? PtrListHead : 0;
}
/// getForwardedTarget - Return the real alias set this represents. If this
@@ -170,13 +177,13 @@
void removeFromTracker(AliasSetTracker &AST);
- void addPointer(AliasSetTracker &AST, HashNodePair &Entry);
+ void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size);
void addCallSite(CallSite CS);
/// aliasesPointer - Return true if the specified pointer "may" (or must)
/// alias one of the members in the set.
///
- bool aliasesPointer(const Value *Ptr, AliasAnalysis &AA) const;
+ bool aliasesPointer(const Value *Ptr, unsigned Size, AliasAnalysis &AA) const;
bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
};
@@ -219,7 +226,7 @@
/// getAliasSetForPointer - Return the alias set that the specified pointer
/// lives in...
- AliasSet &getAliasSetForPointer(Value *P);
+ AliasSet &getAliasSetForPointer(Value *P, unsigned Size);
/// getAliasAnalysis - Return the underlying alias analysis object used by
/// this tracker.
@@ -248,11 +255,11 @@
AliasSet::PointerRec())).first;
}
- void addPointer(Value *P, AliasSet::AccessType E) {
- AliasSet &AS = getAliasSetForPointer(P);
+ void addPointer(Value *P, unsigned Size, AliasSet::AccessType E) {
+ AliasSet &AS = getAliasSetForPointer(P, Size);
AS.AccessTy |= E;
}
- AliasSet *findAliasSetForPointer(const Value *Ptr);
+ AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size);
AliasSet *findAliasSetForCallSite(CallSite CS);
};
More information about the llvm-commits
mailing list