<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> That said, in theory:<br>
><br>
> %a = add 5, 3<br>
> bar = invariant.start(foo, 5)<br>
> load foo<br>
> invariant.end(bar)<br>
><br>
> to<br>
> bar = invariant.start(foo, 5)<br>
> %a = add 5, 3<br>
> load foo<br>
> invariant.end(bar)<br>
><br>
> is probably also illegal, and has the same issues :)<br>
<br></span>
I don't understand why that ^ is a problem.<span class=""><br>
<br></span></blockquote><div><br></div><div>You have extended the scope :)</div><div><br></div><div>Even if the extension is not meaningful :)<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
>     With the memdep changes we will allow reordering loads across the<br>
>     invarinat_start call:<br>
><br>
>        int val = *ptr;<br>
>        invariant_start(ptr)<br>
><br>
>     <==><br>
><br>
>        int val = *ptr;<br>
>        invariant_start(ptr)<br>
><br>
><br>
> (you meant for the first one to have the load after invariant start, i<br>
> presume)<br>
<br></span>
I meant given what we're teaching MDA, the two are equivalent (hence<br>
the "bidirectional arrow" :)).</blockquote><div><br></div><div>I meant that the examples are identical</div><div> :)<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
> I'm willing to give it a shot if you want, i'm just in the "we'll<br>
> probably break something unexpected" camp :)<br>
<br></span>
I now think it is better to add one more special case to AliasAnalysis<br>
around invariant_start s, like we do for assumes.  It's a hack, but at<br>
least a localized hack.</blockquote><div><br></div><div>I already added the same hack to memoryssa, so i can't complain :)</div><div> </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"><br>
<br>
-- Sanjoy<br>
</font></span></blockquote></div><br></div></div>