<div dir="ltr">Vedant<div><br></div><div>Thanks for the pointer. I think that "CHECK: ret" statements are missing.</div><div><br></div><div>-erik</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 2:38 PM, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">check-all runs fine on my machine too. From the logs, I see:<br>
<br>
>> <stdin>:372:7: error: CHECK-NOT: string occurred!<br>
>>  %1 = call double @acos(double 3.000000e+00)<br>
>>       ^<br>
>> /home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/test/Transforms/ConstProp/calls.ll:421:14: note: CHECK-NOT: pattern specified here<br>
>> ; CHECK-NOT: call<br>
<br>
<br>
However, line 421 of calls.ll tests is:<br>
<br>
    "%0 = call float @tanhf(float 3.000000e+00)",<br>
<br>
and the output string FileCheck matches against is:<br>
<br>
    "%1 = call double @acos(double 3.000000e+00)" (from line 430).<br>
<br>
So I suspect that the code is fine but the test case is flaky. I will keep looking at this, but I thought I'd shoot this email back at you now in case it helps :).<br>
<span class="HOEnZb"><font color="#888888"><br>
vedant<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On Aug 27, 2015, at 11:14 AM, Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> wrote:<br>
><br>
> This commit led to test suite failures (see e.g. <<a href="http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/30501" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/30501</a>>), so I reverted it.<br>
><br>
> Locally, everything is fine if I run "make check". Do you have pointers for debugging this?<br>
><br>
> -erik<br>
><br>
> On Thu, Aug 27, 2015 at 12:41 PM, Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> wrote:<br>
> Committed as 246158.<br>
><br>
> -erik<br>
><br>
> On Wed, Aug 26, 2015 at 1:51 PM, Vedant Kumar <<a href="mailto:vsk@apple.com">vsk@apple.com</a>> wrote:<br>
> LGTM, this is ready to land.<br>
><br>
> It turns out that we _can_ combine these tests. I'll take care of it in a followup patch since existing tests need to be changed.<br>
><br>
> > >> +define float @test_atan2f() nounwind uwtable ssp {<br>
> > >> +entry:<br>
> > >> +; CHECK-LABEL: @test_atan2f(<br>
> > >> +; CHECK-NOT: call<br>
> > >> +  %0 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)<br>
> > >> +  ret float %0<br>
> > >> +}<br>
> > >><br>
> > >> +; Shouldn't fold because of -fno-builtin<br>
> > >> +define float @atan2f_() nounwind uwtable ssp {<br>
> > >> +; FNOBUILTIN-LABEL: @atan2f_(<br>
> > >> +; FNOBUILTIN: %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)<br>
> > >> +  %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)<br>
> > >> +  ret float %1<br>
> > >> +}<br>
> ><br>
> > I've noticed many pairs of test functions like the one above. Can this pair be combined into one function? E.g:<br>
> ><br>
> > >> +define float @atan2f_() nounwind uwtable ssp {<br>
> > >> +; CHECK-LABEL: @_atan2f(<br>
> > >> +; FNOBUILTIN-LABEL: @atan2f_(<br>
> > >> +; CHECK-NOT: call<br>
> > >> +; FNOBUILTIN: %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)<br>
> > >> +  %1 = call float @atan2f(float 3.000000e+00, float 4.000000e+00)<br>
> > >> +  ret float %1<br>
> > >> +}<br>
> ><br>
> > I don't know, I'm not too familiar with the test system. These are two different tests: in one, the call should be eliminated (constant-folded), in the other case, it should not. Do you have a pointer to documentation or other examples that cover this detail?<br>
><br>
> Your ">> +; CHECK-NOT: call" lines check that there is "NOT" a "call", i.e the call is folded away. When "-fno-builtin" is passed to the compiler however, we want the call preserved. FileCheck lets you specify different check prefixes for different usage scenarios.<br>
><br>
> Googling "llvm-lit" or "llvm FileCheck" should turn something up.<br>
><br>
> thanks!<br>
> vedant<br>
><br>
> ><br>
> > If so, it would be nice to reduce the test case size. Apart from that, please run clang-format -style=llvm on your changes. Everything else looks good.<br>
> ><br>
> > I attach the updated (re-formatted) patch.<br>
> ><br>
> > -erik<br>
> ><br>
> > vedant<br>
> ><br>
> > On Aug 25, 2015, at 1:14 PM, Erik Schnetter via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> ><br>
> > > It seems that constant propagation for single precision math functions (such as tanf) is already working, but was not enabled. This patch enables these for many single-precision functions, and adds respective test cases.<br>
> > ><br>
> > > List of newly handled functions: acosf asinf atanf atan2f ceilf coshf expf exp2f fabsf floorf fmodf logf log10f powf sinhf tanf tanhf<br>
> > ><br>
> > > -erik<br>
> > ><br>
> > > --<br>
> > > Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> <a href="http://www.perimeterinstitute.ca/personal/eschnetter/" rel="noreferrer" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
> > > <constprop.diff>_______________________________________________<br>
> > > llvm-commits mailing list<br>
> > > <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> > > <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=nRkKAYlatRp-Wgk-tAtmRg&m=zIeTq7C24I26_ny62rhiVNnPUKhiL-ttf5E5SdvSYfM&s=hnzB8DZ-EJj3yM7S-bYX5mwxBMka0n18KAACB3fEHcQ&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=nRkKAYlatRp-Wgk-tAtmRg&m=zIeTq7C24I26_ny62rhiVNnPUKhiL-ttf5E5SdvSYfM&s=hnzB8DZ-EJj3yM7S-bYX5mwxBMka0n18KAACB3fEHcQ&e=</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> <a href="http://www.perimeterinstitute.ca/personal/eschnetter/" rel="noreferrer" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
> > <constprop.diff>_______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> > <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=nRkKAYlatRp-Wgk-tAtmRg&m=pdx8WaNzTKH4XL-GadzDAXtcW_0Dy5TSuEq-r6kr_Cw&s=p1rycXaVwpkLIJ6ivjsTu1JL_CRTjkncrT0wSb31Qy8&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=nRkKAYlatRp-Wgk-tAtmRg&m=pdx8WaNzTKH4XL-GadzDAXtcW_0Dy5TSuEq-r6kr_Cw&s=p1rycXaVwpkLIJ6ivjsTu1JL_CRTjkncrT0wSb31Qy8&e=</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> <a href="http://www.perimeterinstitute.ca/personal/eschnetter/" rel="noreferrer" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
><br>
><br>
><br>
> --<br>
> Erik Schnetter <<a href="mailto:schnetter@gmail.com">schnetter@gmail.com</a>> <a href="http://www.perimeterinstitute.ca/personal/eschnetter/" rel="noreferrer" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Erik Schnetter <<a href="mailto:schnetter@gmail.com" target="_blank">schnetter@gmail.com</a>> <a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br></div>
</div>