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

Frits van Bommel fvbommel at wxs.nl
Mon May 11 11:04:40 PDT 2009

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...

> -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).

More information about the llvm-commits mailing list