[LLVMdev] RFC: liveoncall parameter attribute

Chris Lattner clattner at apple.com
Thu Jun 4 11:00:05 PDT 2015


> On Jun 1, 2015, at 4:28 PM, Philip Reames <listmail at philipreames.com> wrote:
> 
> An alternate approach would be to insert a dummy use into the callee, lower it to a noop late in the backend, and teach the inliner to remove it after inlining.  I suspect this would be both harder to implement and harder to optimize around.


Hi Philip,

Without knowing more, using an intrinsic for this seems like a better way to go: the intrinsic call will keep value alive, and you can special case the behavior for inlining in the inliner, which is apparently the only place where this is problematic.  I suspect that this will be a lot less impact on the existing compiler, be much less likely to break going forward, and also trivially composes across other existing argument attributes.

What are the disadvantages of going with a new intrinsic?

-Chris



More information about the llvm-dev mailing list