[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Mar 12 17:14:02 PST 2004


Changes in directory llvm/lib/Analysis:

BasicAliasAnalysis.cpp updated: 1.31 -> 1.32

---
Log message:

Fix a couple of minor problems.  Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null


---
Diffs of the changes:  (+1 -4)

Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.31 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.32
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.31	Fri Mar 12 16:39:00 2004
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp	Fri Mar 12 17:12:55 2004
@@ -159,9 +159,6 @@
         return true;
       if (AddressMightEscape(I)) return true;
       break;
-    case Instruction::PHI:
-      if (AddressMightEscape(I)) return true;
-      break;
     default:
       return true;
     }
@@ -178,7 +175,7 @@
 BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
   if (!isa<Constant>(P) && !isa<GlobalValue>(P))
     if (const AllocationInst *AI =
-                  dyn_cast<AllocationInst>(getUnderlyingObject(P))) {
+                  dyn_cast_or_null<AllocationInst>(getUnderlyingObject(P))) {
       // Okay, the pointer is to a stack allocated object.  If we can prove that
       // the pointer never "escapes", then we know the call cannot clobber it,
       // because it simply can't get its address.





More information about the llvm-commits mailing list