[PATCH] D72675: [Clang][Driver] Fix -ffast-math/-ffp-contract interaction

Melanie Blower via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 10:51:18 PDT 2020


mibintc added a comment.

In D72675#1919685 <https://reviews.llvm.org/D72675#1919685>, @spatel wrote:

> In D72675#1917844 <https://reviews.llvm.org/D72675#1917844>, @wristow wrote:
>
> > Revisiting this patch.  I think that before fixing the `-ffp-contract=off` problem I originally raised here, there are two questions that have come up in this discussion that we should first resolve.  Specifically:
> >
> > (1)  Do we want to enable FMA transformations by default (at appropriate optimization levels), like GCC does?  That is, should FMA be done for targets that support it with a command as simple as the following?
> >
> >   clang -O2 -c test.c
>
>
> This has been discussed/tried a few times including very recently. I'm not sure where we stand currently, but here's some background:
>  https://reviews.llvm.org/rL282259
>  D74436 <https://reviews.llvm.org/D74436>  - cc @mibintc
>
> And (sorry for the various flavors of links to the dev-lists, but that's how it showed up in the search results):
>  http://lists.llvm.org/pipermail/llvm-dev/2017-March/111129.html
>  http://lists.llvm.org/pipermail/cfe-dev/2020-February/064645.html
>  https://groups.google.com/forum/#!msg/llvm-dev/nBiCD5KvYW0/yfjrVzR7DAAJ
>  https://groups.google.com/forum/#!topic/llvm-dev/Aev2jQYepKQ
>  http://clang-developers.42468.n3.nabble.com/RFC-FP-contract-on-td4056277.html


A few weeks ago there was a discussion on cfe-dev and llvm-dev initiated by @andrew.w.kaylor and while the response wasn't unanimous, there was an overwhelming sentiment (in my opinion) that it is correct and desireable to enable ffp-contract=on by default even at -O0.  I had submitted a patch to do that. However the patch caused performance regressions in about 20 LNT tests and the patch was reverted, the regression was seen on multiple architecture. I can send provide a few more details about the performance problems, I don't have a solution to the LNT regression.


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

https://reviews.llvm.org/D72675





More information about the llvm-commits mailing list