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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Oct 17 14:21:46 PDT 2014


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

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




More information about the llvm-commits mailing list