<div dir="ltr"><div><div>Is the aliasing correct? Check the LHS type with type of x to see that they are properly aliased.<br><br></div>-Kevin<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 August 2016 at 11:07, Krzysztof Parzyszek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have a scenario, roughly like this:<br>
<br>
  if (...) {<br>
    ... = *x<br>
    *x = 0<br>
  } else {<br>
    ... = *x<br>
    *x = 0<br>
  }<br>
<br>
The two sides are functionally different, but both load some value and then set it to 0.<br>
<br>
After GVN Hoist, I get:<br>
<br>
  *x = 0<br>
  if (...) {<br>
    ... = *x<br>
  } else {<br>
    ... = *x<br>
  }<br>
<br>
That is, the store was hoisted above the loads.<br>
<br>
The code is not exactly public, so I can't just attach it as a testcase, but it seems like some simple check is missing somewhere.<br>
<br>
Does this ring a bell?<span class="HOEnZb"><font color="#888888"><br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div>