[PATCH] D26708: Fix -f[no-]reciprocal-math -ffast-math interaction, including LTO

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 07:11:39 PST 2016


kparzysz added a comment.

In https://reviews.llvm.org/D26708#596973, @mehdi_amini wrote:

> > Let me clarify---not to fix this issue here, but in general.  It would make setting/clearing of the individual options much clearer.
>
> Can you give a straw man example of how such options would look like on the command line?


Sure.  For example, something like
`-ffast-math=+noinf,-nonan -ffast-math=+recip`
would enable "no infinities", disable "no NaNs", and enable the use of reciprocals.  Each such occurrence of -ffast-math would behave as if it was combined with all the preceding ones, i.e. the above would be equivalent to `-ffast-math=+noinf,-nonan,+recip`.

There could also be something like -ffast-math=none and -ffast-math=all to disable/enable all available settings respectively.

While the existing options could be handled meaningfully, this scheme has the benefit of being less ambiguous to the user.

The IBM XLC compiler has something similar for -qstrict.


https://reviews.llvm.org/D26708





More information about the llvm-commits mailing list