diff options
author | Melanie Blower <melanie.blower@intel.com> | 2021-07-29 12:02:20 -0400 |
---|---|---|
committer | Melanie Blower <melanie.blower@intel.com> | 2021-07-29 12:02:37 -0400 |
commit | bc5b5ea037dbadd281c59248ae9d2742b51c69ed (patch) | |
tree | 95b5bd94fcca7e04296a39be17960b72ca64408d /clang/test/CodeGen/fp-floatcontrol-class.cpp | |
parent | 4acc2f29a278ff2a0a4d683dd6d706cc2f7123fd (diff) | |
download | llvm-bc5b5ea037dbadd281c59248ae9d2742b51c69ed.zip llvm-bc5b5ea037dbadd281c59248ae9d2742b51c69ed.tar.gz llvm-bc5b5ea037dbadd281c59248ae9d2742b51c69ed.tar.bz2 |
[clang][patch][FPEnv] Make initialization of C++ globals strictfp aware
@kpn pointed out that the global variable initialization functions didn't
have the "strictfp" metadata set correctly, and @rjmccall said that there
was buggy code in SetFPModel and StartFunction, this patch is to solve
those problems. When Sema creates a FunctionDecl, it sets the
FunctionDeclBits.UsesFPIntrin to "true" if the lexical FP settings
(i.e. a combination of command line options and #pragma float_control
settings) correspond to ConstrainedFP mode. That bit is used when CodeGen
starts codegen for a llvm function, and it translates into the
"strictfp" function attribute. See bugs.llvm.org/show_bug.cgi?id=44571
Reviewed By: Aaron Ballman
Differential Revision: https://reviews.llvm.org/D102343
Diffstat (limited to 'clang/test/CodeGen/fp-floatcontrol-class.cpp')
-rw-r--r-- | clang/test/CodeGen/fp-floatcontrol-class.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGen/fp-floatcontrol-class.cpp b/clang/test/CodeGen/fp-floatcontrol-class.cpp index db600ee..8c2e60c 100644 --- a/clang/test/CodeGen/fp-floatcontrol-class.cpp +++ b/clang/test/CodeGen/fp-floatcontrol-class.cpp @@ -8,13 +8,13 @@ float z(); class ON { float w = 2 + y() * z(); // CHECK-LABEL: define {{.*}} @_ZN2ONC2Ev{{.*}} - //CHECK: call float {{.*}}llvm.fmuladd + // CHECK: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict }; ON on; #pragma float_control(except, off) class OFF { float w = 2 + y() * z(); // CHECK-LABEL: define {{.*}} @_ZN3OFFC2Ev{{.*}} - //CHECK: call float {{.*}}llvm.fmuladd + // CHECK-NOT: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict }; OFF off; |