]> git.ipfire.org Git - thirdparty/gcc.git/commit
[committed] [RISC-V] Fix detection of store pair fusion cases
authorJeff Law <jlaw@ventanamicro.com>
Wed, 1 May 2024 17:28:41 +0000 (11:28 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Wed, 1 May 2024 17:28:41 +0000 (11:28 -0600)
commitfad93e7617ce1aafb006983a71b6edc9ae1eb2d1
tree5089cf7e74c1b10fcfefae091295ba86ca490305
parent1fbe1a50d86df11f434351cf62461a32747f9710
[committed] [RISC-V] Fix detection of store pair fusion cases

We've got the ability to count the number of store pair fusions happening in
the front-end of the pipeline.  When comparing some code from last year vs the
current trunk we saw a fairly dramatic drop.

The problem is the store pair fusion detection code was actively harmful due to
a minor bug in checking offsets.   So instead of pairing up 8 byte stores such
as sp+0 with sp+8, it tried to pair up sp+8 and sp+16.

Given uarch sensitivity I didn't try to pull together a testcase.  But we could
certainly see the undesirable behavior in benchmarks as simplistic as dhrystone
up through spec2017.

Anyway, bootstrapped a while back.  Also verified through our performance
counters that store pair fusion rates are back up.  Regression tested with
crosses a few minutes ago.

gcc/
* config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Break out
tests for easier debugging in store pair fusion case.  Fix offset
check in same.
gcc/config/riscv/riscv.cc