[FPEnv] Use strictfp metadata in casting nodes
authorKevin P. Neal <kevin.neal@sas.com>
Fri, 6 Nov 2020 15:44:13 +0000 (10:44 -0500)
committerKevin P. Neal <kevin.neal@sas.com>
Fri, 6 Nov 2020 16:56:12 +0000 (11:56 -0500)
commit2069403cdf35da826937dc40453930c60d52487f
tree5db44b28be3e7e87bea3bc86e827f0f1c5577d13
parentd0b8810fe4ece12213936605b336777ed5fd06cc
[FPEnv] Use strictfp metadata in casting nodes

The strictfp metadata was added to the casting AST nodes in D85960, but
we aren't using that metadata yet. This patch adds that support.

In order to avoid lots of ad-hoc passing around of the strictfp bits I
updated the IRBuilder when moving from a function that has the Expr* to a
function that lacks it. I believe we should switch to this pattern to keep
the strictfp support from being overly invasive.

For the purpose of testing that we're picking up the right metadata, I
also made my tests use a pragma to make the AST's strictfp metadata not
match the global strictfp metadata. This exposes issues that we need to
deal with in subsequent patches, and I believe this is the right method
for most all of our clang strictfp tests.

Differential Revision: https://reviews.llvm.org/D88913
13 files changed:
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGExprComplex.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c
clang/test/CodeGen/builtin_float_strictfp.c [new file with mode: 0644]
clang/test/CodeGen/complex-strictfp.c [new file with mode: 0644]
clang/test/CodeGen/constrained-math-builtins.c
clang/test/CodeGen/exprs-strictfp.c [new file with mode: 0644]
clang/test/CodeGen/fp16-ops-strictfp.c [new file with mode: 0644]
llvm/include/llvm/IR/IRBuilder.h