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

Hal Finkel hfinkel at anl.gov
Fri Oct 17 14:23:07 PDT 2014


----- Original Message -----
> From: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "llvm-commits" <llvm-commits at cs.uiuc.edu>, "Nick Lewycky" <nlewycky at google.com>
> Sent: Friday, October 17, 2014 4:21:46 PM
> Subject: Re: [llvm] r219899 - TRE: make TRE a bit more aggressive
> 
> > 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 :-)

Agreed. Sounds good ;)

 -Hal

> 
> Cheers,
> Rafael
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list