<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 4:05 AM, 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 class="">2017-03-31 1:16 GMT+02:00 Daniel Berlin <<a href="mailto:dberlin@dberlin.org">dberlin@dberlin.org</a>>:<br>
> if you transformed<br>
><br>
> lifetime.start(%p)<br>
> use %p<br>
> lifetime.end(%p)<br>
> into<br>
><br>
> if (c)<br>
>   lifetime.start(%p)<br>
> use %p<br>
> lifetime.end(%p)<br>
><br>
> That is *definitely* a bug in polly.<br>
> 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.<br>
<br>
</span>If it is legal for a frontend to generate it, why is it not legal for<br>
a transformation?<br></blockquote><div><br></div><div>Errr.</div><div>Because, as mentioned, they are not meant to float.</div><div>They are meant to stay executing under precisely the same conditions the frontend gave them.</div><div><br></div><div>Also, the set of things for which it is legal for the frontend to do, but not you, is infinite.</div><div><br></div><div>For example, as mentioned, the frontend may generate:<br><br></div><div>if (c)</div><div>  memset (a, 0)</div><div>use(a)</div><div><br></div><div>But that does not make it legal for you to transform</div><div><br></div><div>memset(a, 0)</div><div>use(a)</div><div><br></div><div>into</div><div>if (c)</div><div>  memset(a, 0)</div><div>use(a)</div><div><br></div><div>unless you can prove a already had the value 0, or that condition c always holds.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
Michael<br>
</font></span></blockquote></div><br></div></div>