[PATCH] D136786: Fix `unsafe-fp-math` attribute emission.

Michele Scandale via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 29 18:49:34 PDT 2022


michele.scandale added a comment.

In D136786#3893485 <https://reviews.llvm.org/D136786#3893485>, @andrew.w.kaylor wrote:

> My understanding is this:
>
>   unsafe-fp-math = exception_behavior(ignore) +
>                    fenv_access(off) +
>                    no_signed_zeros(on) +
>                    allow_reciprocal(on) +
>                    allow_approximate_fns(on) +
>                    allow_reassociation(on) +
>                    fp_contract(fast)
>
> The first two of those settings are the default behavior. The others can be turned on by individual command line options. If all of those semantic modes are in the states above, then we are in "unsafe-fp-math" mode. That's my proposal.

I've updated the patch to use the low level options as you suggested. In the current version of the patch I'm not currently checking explicitly `exception_behavior(ignore) &&  fenv_access(off)` given that the other modes of these properties seems to work only if overall there is the "precise" profile. I don't know if that's acceptable, or if instead the CC1 shouldn't make any assumption about the compiler driver doing the right thing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136786



More information about the cfe-commits mailing list