[llvm-commits] [llvm] r89411 - /llvm/trunk/lib/Analysis/CaptureTracking.cpp

Dan Gohman gohman at apple.com
Thu Nov 19 15:53:49 PST 2009


Author: djg
Date: Thu Nov 19 17:53:49 2009
New Revision: 89411

URL: http://llvm.org/viewvc/llvm-project?rev=89411&view=rev
Log:
Refine this to only apply to null in the default address space.

Modified:
    llvm/trunk/lib/Analysis/CaptureTracking.cpp

Modified: llvm/trunk/lib/Analysis/CaptureTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CaptureTracking.cpp?rev=89411&r1=89410&r2=89411&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/CaptureTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/CaptureTracking.cpp Thu Nov 19 17:53:49 2009
@@ -107,8 +107,10 @@
       break;
     case Instruction::ICmp:
       // Comparing the pointer against null does not count as a capture.
-      if (isa<ConstantPointerNull>(I->getOperand(1)))
-        break;
+      if (ConstantPointerNull *CPN =
+            dyn_cast<ConstantPointerNull>(I->getOperand(1)))
+        if (CPN->getType()->getAddressSpace() == 0)
+          break;
       return true;
     default:
       // Something else - be conservative and say it is captured.





More information about the llvm-commits mailing list