[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 30 16:16:52 PDT 2017


Interesting.
They are marked this way specifically to prevent things from moving them
this way, and it blocks other optimization. So if we are ignoring it to
move them, it seems either "they shouldn't be moved", or "we shouldn't
 mark them" :P


Thinking harder about this.
if you transformed

lifetime.start(%p)
use %p
lifetime.end(%p)
into

if (c)
  lifetime.start(%p)
use %p
lifetime.end(%p)

That is *definitely* a bug in polly.
Stack coloring should be able to handle it if that is the original IR but
that is definitely not a legal transform of the lifetime.start.



On Thu, Mar 30, 2017 at 4:09 PM, Michael Kruse <llvmdev at meinersbur.de>
wrote:

> 2017-03-31 0:54 GMT+02:00 Daniel Berlin <dberlin at dberlin.org>:
> > I'm curious, btw, what made it think the above is legal.
> > The intrinsics are marked as touching memory, having side effects, etc.
>
> The precedes my involvement with Polly.
>
> Polly has a list of intrinsics that can be safely ignored, e.g.
> llvm.dbg.value/llvm.gbg.declare. The lifetime markers are also in this
> list. Ignored intrinsic are ... well ... ignored when generating the
> optimized code.
>
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170330/a5bdcbd6/attachment.html>


More information about the llvm-dev mailing list