[PATCH] D140467: [X86][Reduce] Preserve fast math flags when change it. NFCI
Matt Arsenault via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 22 07:07:26 PST 2022
arsenm added a comment.
In D140467#4013107 <https://reviews.llvm.org/D140467#4013107>, @pengfei wrote:
> Add test case to check FastMathFlagGuard works.
>
> Not to mention above cases. So it doesn't sound feasible to me.
Testing is always feasible. You could even just generate all the combinations
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13116
+ IRBuilder<>::FastMathFlagGuard FMFGuard(Builder);
+
----------------
Should only do this in the cases that actually set the flags
================
Comment at: clang/test/CodeGen/builtins-x86-reduce.c:8
+}
+
+// CHECK: fadd
----------------
Should test the builtins from both sets
================
Comment at: clang/test/CodeGen/builtins-x86-reduce.c:9-11
+// CHECK: fadd
+// CHECK-NOT: nnan
+// CHECK-SAME: double
----------------
use update_cc_test_checks, check-not is super fragile
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140467/new/
https://reviews.llvm.org/D140467
More information about the cfe-commits
mailing list