diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-18 23:31:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-18 23:31:47 +0000 |
commit | eee5400442e0812cb375ed5e17595a62f9240b80 (patch) | |
tree | 6de7757d83b59214c6b3670305520c45b329766f /include | |
parent | 1be4ab681e086ec83e96d543d37e3474ef400282 (diff) | |
download | external_llvm-eee5400442e0812cb375ed5e17595a62f9240b80.zip external_llvm-eee5400442e0812cb375ed5e17595a62f9240b80.tar.gz external_llvm-eee5400442e0812cb375ed5e17595a62f9240b80.tar.bz2 |
Make the representation of AliasSets explicitly differentiate
between "not known yet" and "known no tbaa info" so that it
can merge them properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/AliasSetTracker.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 452724c..f66b3b7 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -44,7 +44,8 @@ class AliasSet : public ilist_node<AliasSet> { const MDNode *TBAAInfo; public: PointerRec(Value *V) - : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0), TBAAInfo(0) {} + : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0), + TBAAInfo(DenseMapInfo<const MDNode *>::getEmptyKey()) {} Value *getValue() const { return Val; } @@ -59,26 +60,22 @@ class AliasSet : public ilist_node<AliasSet> { void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; - if (!TBAAInfo) + if (TBAAInfo == DenseMapInfo<const MDNode *>::getEmptyKey()) + // We don't have a TBAAInfo yet. Set it to NewTBAAInfo. TBAAInfo = NewTBAAInfo; else if (TBAAInfo != NewTBAAInfo) - TBAAInfo = reinterpret_cast<const MDNode *>(-1); + // NewTBAAInfo conflicts with TBAAInfo. + TBAAInfo = DenseMapInfo<const MDNode *>::getTombstoneKey(); } unsigned getSize() const { return Size; } - /// getRawTBAAInfo - Return the raw TBAAInfo member. In addition to - /// being null or a pointer to an MDNode, this could be -1, meaning - /// there was conflicting information. - const MDNode *getRawTBAAInfo() const { - return TBAAInfo; - } - /// getTBAAInfo - Return the TBAAInfo, or null if there is no /// information or conflicting information. const MDNode *getTBAAInfo() const { - // If we have conflicting TBAAInfo, return null. - if (TBAAInfo == reinterpret_cast<const MDNode *>(-1)) + // If we have missing or conflicting TBAAInfo, return null. + if (TBAAInfo == DenseMapInfo<const MDNode *>::getEmptyKey() || + TBAAInfo == DenseMapInfo<const MDNode *>::getTombstoneKey()) return 0; return TBAAInfo; } @@ -209,7 +206,6 @@ public: Value *getPointer() const { return CurNode->getValue(); } unsigned getSize() const { return CurNode->getSize(); } - const MDNode *getRawTBAAInfo() const { return CurNode->getRawTBAAInfo(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement |