<div dir="ltr">(in particular, those things keep LICM from moving them)</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 3:54 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Mar 30, 2017 at 3:45 PM, Michael Kruse <span dir="ltr"><<a href="mailto:llvmdev@meinersbur.de" target="_blank">llvmdev@meinersbur.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>2017-03-31 0:19 GMT+02:00 Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>>:<br>
>> I modified Polly's code generator to produce<br>
>><br>
>> if (c) {<br>
>> llvm.lifetime.start(&var)<br>
>> } else {<br>
>> llvm.lifetime.start(&var)<br>
>> }<br>
>> [...]<br>
>> llvm.lifetime.end(&var)<br>
>><br>
>> and it does not miscompile anymore. However, Polly is currently is not<br>
>> able to compute the lifetime in the general case.<br>
><br>
><br>
> Of course, nothing is.<br>
> But they are also metadata, so you could just drop them if you wanted.<br>
<br>
</span>This is actually exactly what Polly did, but only in the optimized<br>
side of the loop versioning. The original code version is not touched,<br>
which keeps the llvm.lifetime.start in it.<br>
<br>
So of the bug is on Polly's side, I would "fix" it by deleting all<br>
lifetime markers also in the original code.<br></blockquote><div><br></div></span><div>I'm curious, btw, what made it think the above is legal.</div><div>The intrinsics are marked as touching memory, having side effects, etc.</div><div><br></div><div>Do you guys specially ignore them or something?</div><div><br></div></div></div></div>
</blockquote></div><br></div>