<div dir="ltr"><div><div><div><div><div><div><div>Hi Rafael,<br><br></div>I compared the two files 'test-func.ll' and 'test-bad.ll' . I found 1 difference :<br><br></div><div>test-func.ll<br><i>land.lhs.true47:                                  ; preds = %if.end38<br>
  %dec = sext i1 %tobool to i32<br>  %dec.call27 = add i32 %dec, -1</i><br><br></div><div><br></div>test-bad.ll<br><i>land.lhs.true47:                                  ; preds = %if.end38<br>  %addconv = xor i1 %tobool, true<br>
  %dec.call27 = sext i1 %addconv to i32</i><br><br></div>In the patch, i removed the symmetric call -<br><br> <i>// Check if carry bit of addition will not cause overflow.<br>    if (CheckRippleForAdd(LHSKnownZero, LHSKnownOne, RHSKnownZero, RHSKnownOne))<br>
      return true;<br>    if (CheckRippleForAdd(RHSKnownZero, RHSKnownOne, LHSKnownZero, LHSKnownOne))<br>      return true;</i>  --> Removed this call<br><br></div>After removing this last call, when i run opt -instcombine on test-func.ll, the output is same as test-func.ll (seems the issue is resolved atleast from output.)<br>
</div><div><br></div>We can remove the symmetric call because we are sure that one of the operand is constant (as we are determining if we know each bit of one of the operand - one bit set to 1 and all other to 0), and constants are always arranged on RHS, despite their position in original IR. So the last call is not required.<br>
<br></div>The updated patch is working fine for the test-func.ll file now. Can we check if the patch with last call removed doesn't break the sanitizer and arm built bot? I do not know how to run tests for sanitizer and arm built bot. Can someone please run the sanitizer and arm built bot with attached patch :)<br>
<br></div>Attaching updated patch. <br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 1:25 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 29 May 2014 15:41, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>

> OK, I reduced this to llvm::SelectionDAGISel::MorphNode being miscompiled.<br>
<br>
</div>Hi Rafael,<br>
<br>
Just FYI, this also broke the self-hosting ARM bot (but the previous<br>
failure may have masked the bot email):<br>
<br>
<a href="http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a15-self-host" target="_blank">http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a15-self-host</a><br>
<br>
It may be good to have a look on that build after your fix to make<br>
sure all issues have gone away. :)<br>
<br>
cheers,<br>
--renato<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>With regards,<br>Suyog Sarda<br>
</div></div>