[llvm-commits] [llvm] r89434 - /llvm/trunk/lib/Analysis/CaptureTracking.cpp
Duncan Sands
baldrick at free.fr
Fri Nov 20 03:19:56 PST 2009
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
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.
More information about the llvm-commits
mailing list