<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 6:14 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hfinkel added a comment.<br>
<span class=""><br>
In <a href="http://reviews.llvm.org/D22305#483557" rel="noreferrer" target="_blank">http://reviews.llvm.org/D22305#483557</a>, @amehsan wrote:<br>
<br>
> @dberlin<br>
><br>
> I see two concerns in your comment:<br>
><br>
> > > Why not fix GVN to do that?<br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
><br>
> Before GVN this phi node has two different incoming values. At some point A in GVN, one of the incoming values change and we get the phi node in the example above. At some point B in the GVN, the phi node is removed. Somewhere between A and B, GVN makes an alias analysis query. So I think there is not really a problem in GVN to fix.<br>
<br>
<br>
</span>On the one hand, we generally don't construct our analyses to deal with trivially-non-canonical IR. </blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One could argue that if GVN expects to use analyses on its intermediate states, then those states need to follow the rules too. </blockquote><div><br></div><div>+1</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On the other hand, arbitrary uses of RAUW can result in these kinds of PHIs, so this is not really a GVN problem, and handling this reduces our phase-ordering sensitivities. </blockquote><div><br></div><div>Which is also why i asked if anything actually leaves this between passes in practice.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While several passes will clean these up, the same is true for several other things that stripPointerCasts handles.<br></blockquote></div></div></div>