summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-26 19:28:57 +0000
committerChris Lattner <sabre@nondot.org>2003-02-26 19:28:57 +0000
commit2d0a4a4eb88ddc379755f701208dfe4bd1c15055 (patch)
treeeff2a76c77fd0366eb3cad0f3c92fd076df7a79d /lib/Analysis/AliasSetTracker.cpp
parentf98d8d861166a089f69267f8e3a8c261819e809e (diff)
downloadllvm-2d0a4a4eb88ddc379755f701208dfe4bd1c15055.tar.gz
llvm-2d0a4a4eb88ddc379755f701208dfe4bd1c15055.tar.bz2
llvm-2d0a4a4eb88ddc379755f701208dfe4bd1c15055.tar.xz
Convert to work with new AliasAnalysis interface by conservatively assuming all pointers are arbitrarily large accesses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--lib/Analysis/AliasSetTracker.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp
index db704b654a..acb200481a 100644
--- a/lib/Analysis/AliasSetTracker.cpp
+++ b/lib/Analysis/AliasSetTracker.cpp
@@ -13,6 +13,8 @@
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/InstIterator.h"
+// FIXME: This should keep sizes associated with pointers!
+
/// mergeSetIn - Merge the specified alias set into this alias set...
///
void AliasSet::mergeSetIn(AliasSet &AS) {
@@ -59,7 +61,7 @@ void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry){
if (isMustAlias()) // Check to see if we have to downgrade to _may_ alias
if (Value *V = getSomePointer())
- if (AA.alias(V, Entry.first) == AliasAnalysis::MayAlias)
+ if (AA.alias(V, ~0, Entry.first, ~0) == AliasAnalysis::MayAlias)
AliasTy = MayAlias;
Entry.second.setAliasSet(this);
@@ -89,13 +91,13 @@ bool AliasSet::aliasesPointer(const Value *Ptr, AliasAnalysis &AA) const {
// SOME value in the set...
Value *SomePtr = getSomePointer();
assert(SomePtr && "Empty must-alias set??");
- return AA.alias(SomePtr, Ptr);
+ return AA.alias(SomePtr, ~0, Ptr, ~0);
}
// If this is a may-alias set, we have to check all of the pointers in the set
// to be sure it doesn't alias the set...
for (iterator I = begin(), E = end(); I != E; ++I)
- if (AA.alias(Ptr, *I))
+ if (AA.alias(Ptr, ~0, *I, ~0))
return true;
// Check the call sites list and invoke list...
@@ -119,7 +121,7 @@ bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr) {
AliasSet *FoundSet = 0;
for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->aliasesPointer(Ptr, AA)) {
+ if (!I->Forward && I->aliasesPointer(Ptr, AA)) {
if (FoundSet == 0) { // If this is the first alias set ptr can go into...
FoundSet = I; // Remember it.
} else { // Otherwise, we must merge the sets...
@@ -133,10 +135,10 @@ AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr) {
AliasSet *AliasSetTracker::findAliasSetForCallSite(CallSite CS) {
AliasSet *FoundSet = 0;
for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->aliasesCallSite(CS, AA)) {
+ if (!I->Forward && I->aliasesCallSite(CS, AA)) {
if (FoundSet == 0) { // If this is the first alias set ptr can go into...
FoundSet = I; // Remember it.
- } else { // Otherwise, we must merge the sets...
+ } else if (!I->Forward) { // Otherwise, we must merge the sets...
FoundSet->mergeSetIn(*I); // Merge in contents...
}
}