[PATCH] D88913: [FPEnv] Use strictfp metadata in casting nodes

Kevin P. Neal via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 10:54:55 PDT 2020


kpn added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:154-155
+  OldRounding = CGF.Builder.getDefaultConstrainedRounding();
   if (OldFPFeatures == FPFeatures)
     return;
 
----------------
sepavloff wrote:
> This check can be lifted to just after the definition of `OldFPFeatures`.
Actually, no, because this leaves OldExcept and OldRounding uninitialized when they get used by the destructor.


================
Comment at: clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c:26
+// metadata from the AST instead of the global default from the command line.
+// FIXME: All cases of "fpexcept.maytrap" in this test are wrong.
+
----------------
sepavloff wrote:
> kpn wrote:
> > sepavloff wrote:
> > > Why they are wrong?
> > Because the #pragma covers the entire file and sets exception handling to "strict". Thus all constrained intrinsic calls should be "strict", and if they are "maytrap" or "ignore" then we have a bug.
> What is the reason for that? Does `#pragma float_control` work incorrectly? Why  in `clang/test/CodeGen/complex-math-strictfp.c` exception handling is correct?
The #pragma works just fine. The problem is that we need to get the strictfp bits from the AST to the IRBuilder, and we haven't finished implementing that. So sometimes it works, like in complex-math-strictfp.c, and sometimes it doesn't. As you can see in the tests in this patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88913/new/

https://reviews.llvm.org/D88913



More information about the cfe-commits mailing list