[cfe-commits] r165196 - /cfe/trunk/test/CodeGen/fp-contract-pragma.cpp

David Blaikie dblaikie at gmail.com
Thu Oct 4 00:25:44 PDT 2012


On Wed, Oct 3, 2012 at 8:07 PM, Lang Hames <lhames at gmail.com> wrote:
> Author: lhames
> Date: Wed Oct  3 22:07:37 2012
> New Revision: 165196
>
> URL: http://llvm.org/viewvc/llvm-project?rev=165196&view=rev
> Log:
> Test file-scoped FP_CONTRACT pragma.
>
> Modified:
>     cfe/trunk/test/CodeGen/fp-contract-pragma.cpp
>
> Modified: cfe/trunk/test/CodeGen/fp-contract-pragma.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/fp-contract-pragma.cpp?rev=165196&r1=165195&r2=165196&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/fp-contract-pragma.cpp (original)
> +++ cfe/trunk/test/CodeGen/fp-contract-pragma.cpp Wed Oct  3 22:07:37 2012
> @@ -46,3 +46,20 @@
>  template class fp_contract_4<int>;
>  // CHECK: _ZN13fp_contract_4IiE6methodEfff
>  // CHECK: tail call float @llvm.fmuladd

This is slightly delayed CR feedback, but I noticed it in this review:

a) it seems overconstrained to specifically check for tail calls
b) That got me thinking: how are these tail calls anyway? & I see
you're running this with -O3. Which means you're sort of testing both
Clang and LLVM. It's preferable to test only Clang in Clang tests (&
if there's some relevant optimization in LLVM you want to test, to
test that using an LLVM IR-level test). Is there a reason you needed
to test with optimizations here?

> +
> +// Check file-scoped FP_CONTRACT
> +#pragma STDC FP_CONTRACT ON
> +float fp_contract_5(float a, float b, float c) {
> +// CHECK: _Z13fp_contract_5fff
> +// CHECK: tail call float @llvm.fmuladd
> +  return a * b + c;
> +}
> +
> +#pragma STDC FP_CONTRACT OFF
> +float fp_contract_6(float a, float b, float c) {
> +// CHECK: _Z13fp_contract_6fff
> +// CHECK: %[[M:.+]] = fmul float %a, %b
> +// CHECK-NEXT: fadd float %[[M]], %c
> +  return a * b + c;
> +}
> +
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list