]> git.ipfire.org Git - thirdparty/gcc.git/commit
math-opts: Add dbgcounter for FMA formation
authorMartin Jambor <mjambor@suse.cz>
Tue, 12 Sep 2023 17:22:37 +0000 (19:22 +0200)
committerMartin Jambor <mjambor@suse.cz>
Tue, 12 Sep 2023 17:23:20 +0000 (19:23 +0200)
commit27e2e7c93e48bcbb63877cc5964fae8dba47d706
tree5e8a2b2d5cf5e1bbcfa58376c6bc1ff9fb3bb584
parent2e36c4a04a4f0cdd59684d1d771a477796313be3
math-opts: Add dbgcounter for FMA formation

This patch is a simple addition of a debug counter to FMA formation in
tree-ssa-math-opts.cc.  Given that issues with FMAs do occasionally
pop up, it seems genuinely useful.

I simply added an if right after the initial checks in
convert_mult_to_fma even though when FMA formation deferring is
active (i.e. when targeting Zen CPUs) this would interact with it (and
at this moment lead to producing all deferred candidates), so when
using the dbg counter to find a harmful set of FMAs, it is probably
best to also set param_avoid_fma_max_bits to zero.  I could not find a
better place which would not also make the code unnecessarily more
complicated.

gcc/ChangeLog:

2023-09-06  Martin Jambor  <mjambor@suse.cz>

* dbgcnt.def (form_fma): New.
* tree-ssa-math-opts.cc: Include dbgcnt.h.
(convert_mult_to_fma): Bail out if the debug counter say so.
gcc/dbgcnt.def
gcc/tree-ssa-math-opts.cc