diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-04 22:23:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-04 22:23:21 +0000 |
commit | b919b217770c4dcc40d2ed704b44790eedc88e60 (patch) | |
tree | 4ec8bd661e488d5cd273cb7718f3795605ac6d8f /llvm/lib/Analysis/IPA/Andersens.cpp | |
parent | 0933766e2babaefb70c6acd4ab3bea2adfc736bf (diff) | |
download | bcm5719-llvm-b919b217770c4dcc40d2ed704b44790eedc88e60.tar.gz bcm5719-llvm-b919b217770c4dcc40d2ed704b44790eedc88e60.zip |
do not dereference an extra layer of pointers to determine if an external
call can modify a memory location. This fixes
test/Regression/Analysis/Andersens/modreftest.ll
llvm-svn: 21088
Diffstat (limited to 'llvm/lib/Analysis/IPA/Andersens.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/Andersens.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index 146c88aaebd..2bfac755507 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -374,19 +374,12 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) { Node *N1 = getNode(P); bool PointsToUniversalSet = false; - for (Node::iterator NI = N1->begin(), E = N1->end(); NI != E; ++NI) { - Node *PN = *NI; - if (PN->begin() == PN->end()) - continue; // P doesn't point to anything. - // Get the first pointee. - Node *FirstPointee = *PN->begin(); - if (FirstPointee == &GraphNodes[UniversalSet]) { - PointsToUniversalSet = true; - break; - } - } + if (N1->begin() == N1->end()) + return NoModRef; // P doesn't point to anything. - if (!PointsToUniversalSet) + // Get the first pointee. + Node *FirstPointee = *N1->begin(); + if (FirstPointee != &GraphNodes[UniversalSet]) return NoModRef; // P doesn't point to the universal set. } |