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

Chris Lattner clattner at apple.com
Sat Nov 21 07:20:22 PST 2009


On Nov 20, 2009, at 3:19 AM, Duncan Sands wrote:

> Hi Dan,
> 
>> +      // Don't count comparisons of two pointers within the same object
>> +      // as captures.
>> +      if (I->getOperand(0)->getUnderlyingObject() ==
>> +          I->getOperand(1)->getUnderlyingObject())
> 
> I think this bit is ok if you only do equality/inequality comparisons, but
> is wrong if you allow inequality comparisons.  The reason is that this

Isn't this safe with an inbounds gep?

-Chris

> 
>     Q = GEP P, -n
>     if (Q == null)
>       break;
> 
> (see example from previous email) is equivalent to this
> 
>     Q = GEP P, -(n+1)
>     if (Q > P)
>       break;
> 
> and here you are comparing pointers with the same underlying object.
> 
> Ciao,
> 
> Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list