]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/106293 - missed DSE with virtual LC PHI
authorRichard Biener <rguenther@suse.de>
Tue, 10 Jan 2023 12:48:51 +0000 (13:48 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 10 Jan 2023 15:53:51 +0000 (16:53 +0100)
commit4e0b504f26f78ff02e80ad98ebbf8ded3aa6ffa1
tree5fe5af8efc582baee5bab8fd36d7c18e15338c9d
parent851e1ba03f9de699a754dd8648fc151c3e26d697
tree-optimization/106293 - missed DSE with virtual LC PHI

Degenerate virtual PHIs can break DSEs fragile heuristic as to what
defs it can handle for further processing.  The following enhances
it to look through degenerate PHIs by means of a worklist, processing
the degenerate PHI defs uses to the defs array.  The rewrite of
virtuals into loop-closed SSA caused this to issue appear more often.
The patch itself is mostly re-indenting the new loop body.

PR tree-optimization/106293
* tree-ssa-dse.cc (dse_classify_store): Use a worklist to
process degenerate PHI defs.

* gcc.dg/tree-ssa/ssa-dse-46.c: New testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-46.c [new file with mode: 0644]
gcc/tree-ssa-dse.cc