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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 11:23:46 PDT 2020


spatel added a comment.

In D72675#1919793 <https://reviews.llvm.org/D72675#1919793>, @mibintc wrote:

> 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.


Thanks for the update! I saw your questions about digging into the LNT regressions, but I don't have the answers (ping that message in case someone out there missed it?). 
Let's break this into pieces and see if we can make progress apart from that:

1. Where is the list of LNT tests that showed problems?
2. Were the regressions on x86 bots? If so, many developers can likely repro those locally.
3. For regressions on other targets, we can guess at the problems by comparing asm (or recruit someone with the target hardware?).


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

https://reviews.llvm.org/D72675





More information about the llvm-commits mailing list