<div dir="ltr"><div>Hi Nick,<br><br></div>The reciprocal fix is in at r241826. Please let me know when you find another failure. Thanks!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 22, 2015 at 3:43 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 22 June 2015 at 14:09, Sanjay Patel <span dir="ltr"><<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks, Nick.<br><br></div>This is the same bug (convert repeated divisions by the same divisor to multiplication by the reciprocal) that should be solved by D9893 ( <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9893&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=lmpOuktPk8NkbSUTnEt3L4tA3g6ucAcGnVJj9VdIgdc&s=M8SPcMJyplzLM674fk9N0pwA1xgSa94VANiaAnz2chc&e=" target="_blank">http://reviews.llvm.org/D9893</a> ). After I apply that patch, the output asm looks correct to me.<br></div></blockquote><div><br></div></span><div>OK! Let me know once that lands and I'll re-test it. There were a lot of failures, so there may be something more left after this particular problem is resolved.</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 19, 2015 at 5:53 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>On 17 June 2015 at 13:57, Sanjay Patel <span dir="ltr"><<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 12:59 AM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>Sanjay Patel wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Please let me know if I can still take you up on this offer:<br>
"Could you add FMF under a flag and then let me test it before turning it on? I can test for compiler crashes in 24 hours, or for miscompiles over a weekend."<br>
</blockquote>
<br></span>
Right! Yes, I can do that.<br></blockquote><div><br></div></span><div>Great! Let me know when you see bugs crawling out from under the rug. :)</div></div></div></div></blockquote><div><br></div></div></div><div>Just finished the first creduce.</div><div><br></div><div>Testcase:</div><div><br></div><div><div>int a, b, c;</div><div>void fn1() {</div><div>  b = c / (1.0 + c);</div><div>  a = 1 / (1.0 + c);</div><div>}</div></div><div><br></div><div>Build with "clang -O2 -mllvm -enable-fmf-dag -ffast-math" to get</div><div><br></div><div> fatal error: error in backend: Cannot select: 0x2a8a760: f64 =</div><div>      ConstantFP<1.000000e+00> [ID=7]</div><div>In function: _Z3fn1v</div><div><br></div><div>and here it is as .ll:</div><div><br></div><div><div>target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"</div><div>target triple = "x86_64-grtev4-linux-gnu"</div><div><br></div><div>@a = global i32 0, align 4</div><div>@b = global i32 0, align 4</div><div>@c = global i32 0, align 4</div><div><br></div><div>; Function Attrs: nounwind uwtable</div><div>define void @_Z3fn1v() #0 {</div><div>  %1 = load i32, i32* @c, align 4, !tbaa !1</div><div>  %2 = sitofp i32 %1 to double</div><div>  %3 = fadd fast double %2, 1.000000e+00</div><div>  %4 = fdiv fast double %2, %3</div><div>  %5 = fptosi double %4 to i32</div><div>  store i32 %5, i32* @b, align 4, !tbaa !1</div><div>  %6 = fdiv fast double 1.000000e+00, %3</div><div>  %7 = fptosi double %6 to i32</div><div>  store i32 %7, i32* @a, align 4, !tbaa !1</div><div>  ret void</div></div><div><div>}</div><div><br></div><div>attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="true" "use-soft-float"="false" }</div><div><br></div><div>!llvm.ident = !{!0}</div><div><br></div><div>!0 = !{!"clang version google3-trunk (trunk r240125)"}</div><div>!1 = !{!2, !2, i64 0}</div><div>!2 = !{!"int", !3, i64 0}</div><div>!3 = !{!"omnipotent char", !4, i64 0}</div><div>!4 = !{!"Simple C/C++ TBAA"}</div></div><div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>