[PATCH] D80315: Fix CC1 command line options mapping into fast-math flags.

Michele Scandale via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 16:56:09 PDT 2020


michele.scandale added a comment.

In D80315#2058549 <https://reviews.llvm.org/D80315#2058549>, @rjmccall wrote:

> The code cleanups all seems reasonable.  The actual changes in code-generation changes are because we were failing to set these reliably?


Most of them yes.

In the CUDA test we there is now `contract` because we honor the default contraction mode that for CUDA is set to fast.

In `clang/test/CodeGen/complex-math.c` I've added `-ffp-contract=fast` to the command line option because `-ffast-math` at the CC1 level does not change the default contraction mode. We might want to treat `-ffast-math` similarly to `-cl-fast-relaxed-math`, i.e. it implies by default the "fast" contraction mode. Before this change there behavior was accidentally the same as "-ffast-math changes the default contraction mode" because there was:

  if (CGM.getLangOpts().FastMath)
    FMF.setFast()

and so the bit for `AllowContract` was enabled in the fast-math flags.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80315





More information about the cfe-commits mailing list