Michael Kruse via llvm-dev
2017-Mar-30 22:45 UTC
[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
2017-03-31 0:19 GMT+02:00 Daniel Berlin <dberlin at dberlin.org>:>> I modified Polly's code generator to produce >> >> if (c) { >> llvm.lifetime.start(&var) >> } else { >> llvm.lifetime.start(&var) >> } >> [...] >> llvm.lifetime.end(&var) >> >> and it does not miscompile anymore. However, Polly is currently is not >> able to compute the lifetime in the general case. > > > Of course, nothing is. > But they are also metadata, so you could just drop them if you wanted.This is actually exactly what Polly did, but only in the optimized side of the loop versioning. The original code version is not touched, which keeps the llvm.lifetime.start in it. So of the bug is on Polly's side, I would "fix" it by deleting all lifetime markers also in the original code. Michael
Daniel Berlin via llvm-dev
2017-Mar-30 22:54 UTC
[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
On Thu, Mar 30, 2017 at 3:45 PM, Michael Kruse <llvmdev at meinersbur.de> wrote:> 2017-03-31 0:19 GMT+02:00 Daniel Berlin <dberlin at dberlin.org>: > >> I modified Polly's code generator to produce > >> > >> if (c) { > >> llvm.lifetime.start(&var) > >> } else { > >> llvm.lifetime.start(&var) > >> } > >> [...] > >> llvm.lifetime.end(&var) > >> > >> and it does not miscompile anymore. However, Polly is currently is not > >> able to compute the lifetime in the general case. > > > > > > Of course, nothing is. > > But they are also metadata, so you could just drop them if you wanted. > > This is actually exactly what Polly did, but only in the optimized > side of the loop versioning. The original code version is not touched, > which keeps the llvm.lifetime.start in it. > > So of the bug is on Polly's side, I would "fix" it by deleting all > lifetime markers also in the original code. >I'm curious, btw, what made it think the above is legal. The intrinsics are marked as touching memory, having side effects, etc. Do you guys specially ignore them or something? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170330/2e2f21e9/attachment.html>
Daniel Berlin via llvm-dev
2017-Mar-30 22:54 UTC
[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
(in particular, those things keep LICM from moving them) On Thu, Mar 30, 2017 at 3:54 PM, Daniel Berlin <dberlin at dberlin.org> wrote:> > > On Thu, Mar 30, 2017 at 3:45 PM, Michael Kruse <llvmdev at meinersbur.de> > wrote: > >> 2017-03-31 0:19 GMT+02:00 Daniel Berlin <dberlin at dberlin.org>: >> >> I modified Polly's code generator to produce >> >> >> >> if (c) { >> >> llvm.lifetime.start(&var) >> >> } else { >> >> llvm.lifetime.start(&var) >> >> } >> >> [...] >> >> llvm.lifetime.end(&var) >> >> >> >> and it does not miscompile anymore. However, Polly is currently is not >> >> able to compute the lifetime in the general case. >> > >> > >> > Of course, nothing is. >> > But they are also metadata, so you could just drop them if you wanted. >> >> This is actually exactly what Polly did, but only in the optimized >> side of the loop versioning. The original code version is not touched, >> which keeps the llvm.lifetime.start in it. >> >> So of the bug is on Polly's side, I would "fix" it by deleting all >> lifetime markers also in the original code. >> > > I'm curious, btw, what made it think the above is legal. > The intrinsics are marked as touching memory, having side effects, etc. > > Do you guys specially ignore them or something? > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170330/d27549bc/attachment.html>
Michael Kruse via llvm-dev
2017-Mar-30 23:09 UTC
[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
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
Reasonably Related Threads
- Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
- Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
- Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
- Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics
- Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics