[llvm-branch-commits] [llvm-branch] r89485 - /llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp

Dan Gohman gohman at apple.com
Fri Nov 20 12:56:02 PST 2009


Author: djg
Date: Fri Nov 20 14:56:02 2009
New Revision: 89485

URL: http://llvm.org/viewvc/llvm-project?rev=89485&view=rev
Log:
$ svn merge -c 89468 https://djg@llvm.org/svn/llvm-project/llvm/trunk
--- Merging r89468 into '.':
U    lib/Analysis/CaptureTracking.cpp
$ svn merge -c 89472 https://djg@llvm.org/svn/llvm-project/llvm/trunk
--- Merging r89472 into '.':
G    lib/Analysis/CaptureTracking.cpp

Modified:
    llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp

Modified: llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp?rev=89485&r1=89484&r2=89485&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Analysis/CaptureTracking.cpp Fri Nov 20 14:56:02 2009
@@ -106,19 +106,14 @@
       }
       break;
     case Instruction::ICmp:
-      // Don't count comparisons of the original value against null as captures.
-      // This allows us to ignore comparisons of malloc results with null,
-      // for example.
-      if (isIdentifiedObject(V))
+      // Don't count comparisons of a no-alias return value against null as
+      // captures. This allows us to ignore comparisons of malloc results
+      // with null, for example.
+      if (isNoAliasCall(V->stripPointerCasts()))
         if (ConstantPointerNull *CPN =
               dyn_cast<ConstantPointerNull>(I->getOperand(1)))
           if (CPN->getType()->getAddressSpace() == 0)
             break;
-      // Don't count comparisons of two pointers within the same object
-      // as captures.
-      if (I->getOperand(0)->getUnderlyingObject() ==
-          I->getOperand(1)->getUnderlyingObject())
-        break;
       // Otherwise, be conservative. There are crazy ways to capture pointers
       // using comparisons.
       return true;





More information about the llvm-branch-commits mailing list