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

John McCall rjmccall at apple.com
Tue Nov 24 14:20:43 PST 2009


Duncan Sands wrote:
> Anyway, I whipped up a quick implementation of this, see attached 
> patch.  It
> is a bit more complicated than what I said above because loading the 
> pointer
> and returning the loaded value is not considered to capture it.  Also, 
> to please
> Dan, it allows stores to alloca's and tracks what happens to the 
> alloca.  It is
> much more liberal than what we had before, however it does do less 
> well in two
> cases: previously if the pointer was a phi node operand or the operand 
> of a
> select, then we would not consider returning a load of the phi/select 
> pointer to
> be a capture, but now we do.  That's because it's not immediately 
> clear to me
> how to handle these cases better in this context.

If we're not going to consider "correlated" captures, shouldn't the 
model just be taint-checking?  The original parameter is tainted, GEPs 
are tainted, phis to which it's an input are tainted, possibly some 
other things.  The parameter is nocapture only if there's no "capturing" 
use of a tainted value.  That's about as good as you're going to get 
without a lot of (expensive) sophistication.

John.



More information about the llvm-commits mailing list