[PATCH] D107994: Making the code compliant to the documentation about Floating Point support default values for C/C++. FPP-MODEL=PRECISE enables FFP-CONTRACT (FMA is enabled).
Zahira Ammarguellat via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 10 12:10:34 PST 2021
zahiraam added a comment.
In D107994#3115589 <https://reviews.llvm.org/D107994#3115589>, @thakis wrote:
> This fixes tests on macOS, but I don't know if the space is there intentionally to check for presence of any attributes:
>
> % git diff
> diff --git a/clang/test/CodeGen/ffp-contract-option.c b/clang/test/CodeGen/ffp-contract-option.c
> index 04d23d5f90b7..327722f56f4e 100644
> --- a/clang/test/CodeGen/ffp-contract-option.c
> +++ b/clang/test/CodeGen/ffp-contract-option.c
> @@ -63,7 +63,7 @@
> // RUN: --check-prefixes=CHECK,CHECK-FPC-ON
>
> float mymuladd(float x, float y, float z) {
> - // CHECK: define {{.*}} float @mymuladd(float noundef %x, float noundef %y, float noundef %z)
> + // CHECK: define{{.*}} float @mymuladd(float noundef %x, float noundef %y, float noundef %z)
> return x * y + z;
> // expected-warning{{overriding '-ffp-contract=fast' option with '-ffp-contract=on'}}
>
> diff --git a/clang/test/CodeGen/ffp-model.c b/clang/test/CodeGen/ffp-model.c
> index ee0eedb2718f..98d31106a119 100644
> --- a/clang/test/CodeGen/ffp-model.c
> +++ b/clang/test/CodeGen/ffp-model.c
> @@ -19,7 +19,7 @@
> // RUN: --check-prefixes CHECK,CHECK-FAST1
>
> float mymuladd(float x, float y, float z) {
> - // CHECK: define {{.*}} float @mymuladd(float noundef %x, float noundef %y, float noundef %z)
> + // CHECK: define{{.*}} float @mymuladd(float noundef %x, float noundef %y, float noundef %z)
> return x * y + z;
> // CHECK-FAST: fmul fast float
>
> If this is the right fix, please land it. Else I'll revert again in 30 min or so; bots have been broken for hours by now.
================
Comment at: clang/test/CodeGen/ffp-model.c:4
+// RUN: | FileCheck %s \
+// RUN: --check-prefixes=CHECK,CHECK-FAST --strict-whitespace
+
----------------
zahiraam wrote:
> andrew.w.kaylor wrote:
> > Why did you add the strict-whitespace option?
> Because on some targets, the IR generated for the define is "define {{.*}}float @mymuladd" and on and some others it is
> "define {{.*}} float @mymuladd" (space between {{.*}} and float.
I was trying to fix the issue with the define function check.
With this run command:
// RUN: %clang -S -emit-llvm -fno-fast-math -emit-llvm -target x86_64-apple-macosx10.11 %s -o -
I get this IR:
define float @mymuladd(float noundef %x, float noundef %y, float noundef %z)
This wouldn't be represented by
// CHECK: define {{.*}} float @mymuladd
but by
// CHECK: define{{.*}} float @mymuladd
or
// CHECK: define {{.*}}float @mymuladd
But I get replacing with // CHECK: define{{.*}} float @mymuladd
Should solve the issue. Right?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107994/new/
https://reviews.llvm.org/D107994
More information about the cfe-commits
mailing list