]> gcc.gnu.org Git - gcc.git/commit
sra: Do not leave work for DSE (that it can sometimes not perform)
authorMartin Jambor <mjambor@suse.cz>
Thu, 9 May 2024 14:39:44 +0000 (16:39 +0200)
committerMartin Jambor <mjambor@suse.cz>
Thu, 9 May 2024 14:51:15 +0000 (16:51 +0200)
commitf6743695b4d2bd4da96e56a19157372f93b800bd
treefcfdf7d1f26c430db4dc425212a821d24a23492e
parent2790195500ec523cad9c7292816540e2fc19f456
sra: Do not leave work for DSE (that it can sometimes not perform)

When looking again at the g++.dg/tree-ssa/pr109849.C testcase we
discovered that it generates terrible store-to-load forwarding stalls
because SRA was leaving behind aggregate loads but all the stores were
by scalar parts and DSE failed to remove the useless load.  SRA has
all the knowledge to remove the statement even now, so this small
patch makes it do so.

With this patch, the g++.dg/tree-ssa/pr109849.C micro-benchmark runs 9
times faster (on an AMD EPYC 75F3 machine).

gcc/ChangeLog:

2024-04-18  Martin Jambor  <mjambor@suse.cz>

* tree-sra.cc (sra_modify_assign): Remove the original statement
also when dealing with a store to a fully covered aggregate from a
non-candidate.

gcc/testsuite/ChangeLog:

2024-04-23  Martin Jambor  <mjambor@suse.cz>

* g++.dg/tree-ssa/pr109849.C: Also check that the aggeegate store
to cur disappears.
* gcc.dg/tree-ssa/ssa-dse-26.c: Instead of relying on DSE,
check that the unwanted stores were removed at early SRA time.
gcc/testsuite/g++.dg/tree-ssa/pr109849.C
gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
gcc/tree-sra.cc
This page took 0.06956 seconds and 5 git commands to generate.