aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-14 04:51:34 +0000
committerChris Lattner <sabre@nondot.org>2003-12-14 04:51:34 +0000
commitbb8f4769a2ee48b82c30de52083942781e920dd9 (patch)
treee225cd357a07813c849cdc184eb83e9c8c126c58 /include
parent15beaf7d6548364036c6e92f7b29d129988757f0 (diff)
downloadexternal_llvm-bb8f4769a2ee48b82c30de52083942781e920dd9.zip
external_llvm-bb8f4769a2ee48b82c30de52083942781e920dd9.tar.gz
external_llvm-bb8f4769a2ee48b82c30de52083942781e920dd9.tar.bz2
Add capability to represent volatile AliasSet's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/AliasSetTracker.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h
index fe57c28..2195253 100644
--- a/include/llvm/Analysis/AliasSetTracker.h
+++ b/include/llvm/Analysis/AliasSetTracker.h
@@ -82,7 +82,7 @@ class AliasSet {
// RefCount - Number of nodes pointing to this AliasSet plus the number of
// AliasSets forwarding to it.
- unsigned RefCount : 29;
+ unsigned RefCount : 28;
/// AccessType - Keep track of whether this alias set merely refers to the
/// locations of memory, whether it modifies the memory, or whether it does
@@ -103,6 +103,9 @@ class AliasSet {
};
unsigned AliasTy : 1;
+ // Volatile - True if this alias set contains volatile loads or stores.
+ bool Volatile : 1;
+
friend class ilist_traits<AliasSet>;
AliasSet *getPrev() const { return Prev; }
AliasSet *getNext() const { return Next; }
@@ -116,6 +119,11 @@ public:
bool isMustAlias() const { return AliasTy == MustAlias; }
bool isMayAlias() const { return AliasTy == MayAlias; }
+ // isVolatile - Return true if this alias set contains volatile loads or
+ // stores.
+ bool isVolatile() const { return Volatile; }
+
+
/// isForwardingAliasSet - Return true if this alias set should be ignored as
/// part of the AliasSetTracker object.
bool isForwardingAliasSet() const { return Forward; }
@@ -168,7 +176,7 @@ public:
private:
// Can only be created by AliasSetTracker
AliasSet() : PtrListHead(0), PtrListTail(0), Forward(0), RefCount(0),
- AccessTy(NoModRef), AliasTy(MustAlias) {
+ AccessTy(NoModRef), AliasTy(MustAlias), Volatile(false) {
}
HashNodePair *getSomePointer() const {
return PtrListHead ? PtrListHead : 0;
@@ -194,6 +202,7 @@ private:
void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size);
void addCallSite(CallSite CS);
+ void setVolatile() { Volatile = true; }
/// aliasesPointer - Return true if the specified pointer "may" (or must)
/// alias one of the members in the set.
@@ -272,9 +281,10 @@ private:
AliasSet::PointerRec())).first;
}
- void addPointer(Value *P, unsigned Size, AliasSet::AccessType E) {
+ AliasSet &addPointer(Value *P, unsigned Size, AliasSet::AccessType E) {
AliasSet &AS = getAliasSetForPointer(P, Size);
AS.AccessTy |= E;
+ return AS;
}
AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size);