[llvm-commits] [llvm] r71443 - /llvm/trunk/lib/Target/README.txt

Chris Lattner clattner at apple.com
Mon May 11 11:09:42 PDT 2009

On May 11, 2009, at 11:04 AM, Frits van Bommel wrote:

> Chris Lattner wrote:
>> Log:
>> remove some done things: we have nocapture and SROA is smarter.
>> -2. Generalize readonly to be set on parameters.  This is important  
>> mod/ref
>> -   info for the function, which is important for basicaa and  
>> others.  It can
>> -   also be used by the inliner to avoid inserting a memcpy for byval
>> -   arguments when the function is inlined.
> I wasn't aware this was implemented? It's not in LangRef.html...

No, but this is sufficiently dubious that it isn't worth being in  

>> -These functions can be inferred by various analysis passes such as  
>> the
>> -globalsmodrefaa pass.  Note that getting #2 right is actually  
>> really tricky.
>> -Consider this code:
>> -
>> -struct S;  S G;
>> -void caller(S byvalarg) { G.field = 1; ... }
>> -void callee() { caller(G); }
>> -
>> -The fact that the caller does not modify byval arg is not enough,  
>> we need
>> -to know that it doesn't modify G either.  This is very tricky.
> Is this trickyness the reason it was given up on?


> Can't the attribute just mean it's not modified through the  
> parameter, so that
> passes wanting to use this information would also need to prove the  
> argument
> being passed in at the particular callsite is not modified through  
> other means?
> That way e.g. non-escaped locals could still benefit from this (even  
> if a global
> was passed in at some other callsite).

That isn't particularly useful information for the optimizers.  When/ 
if we tackle something like this, this entry in the readme won't be  


More information about the llvm-commits mailing list