[llvm] r219899 - TRE: make TRE a bit more aggressive

Nick Lewycky nlewycky at google.com
Fri Oct 17 14:24:53 PDT 2014


On 17 October 2014 14:21, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
wrote:

> > Can we also update the LangRef to spell this out? The "Both markers
> imply that the callee does not access allocas or varargs from the caller."
> does not clearly cover byval arguments (in practice they're often
> implemented similarly to non-entry-block allocas in the caller, but they
> could be on the callee's stack frame in some ABIs, and regardless, at the
> IR level they're not allocas). The byval documentation says only, "The
> attribute implies that a hidden copy of the pointee is made between the
> caller and the callee, so the callee is unable to modify the value in the
> caller." so it does not specify in which stack frame the pointer is
> considered to reside.
>
> So, with this interpretation what should happen is
>
> * The tail call is valid with the byval.
> * The inliner must drop the tail marker, since it is the thing
> converting a byval into an alloca.
>

The inliner already has to strip off tails from calls in the callee's
function body anyways. See the call to setTailCallKind in
llvm::InlineFunction.

I can't remember why this was not the preferred reading of the
> language reference when PR7272 was first fixed.
>
> In any case. The test is an end to end check to make sure we pass the
> correct value after inlining and cleanups. It seems better to have it
> passing first and then figure what we want to change :-)
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141017/45b8b23c/attachment.html>


More information about the llvm-commits mailing list