]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/99912 - delete trivially dead stmts during DSE
authorRichard Biener <rguenther@suse.de>
Tue, 27 Apr 2021 12:32:27 +0000 (14:32 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 29 Apr 2021 06:32:14 +0000 (08:32 +0200)
commitb58dc0b803057c0e6032e0d9bd92cd834f72c75c
tree10646b0a8e6364098f9965acdf76056e136f14e4
parent8ddce3f7d0db060885df24e41dd289173ec774a0
tree-optimization/99912 - delete trivially dead stmts during DSE

DSE performs a backwards walk over stmts removing stores but it
leaves removing resulting dead SSA defs to later passes.  This
eats into its own alias walking budget if the removed stores kept
loads live.  The following patch adds removal of trivially dead
SSA defs which helps in this situation and reduces the amount of
garbage followup passes need to deal with.

2021-04-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99912
* tree-ssa-dse.c (dse_dom_walker::m_need_cfg_cleanup): New.
(dse_dom_walker::todo): Likewise.
(dse_dom_walker::dse_optimize_stmt): Move VDEF check to the
caller.
(dse_dom_walker::before_dom_children): Remove trivially
dead SSA defs and schedule CFG cleanup if we removed all
PHIs in a block.
(pass_dse::execute): Get TODO as computed by the DOM walker
and return it.  Wipe dominator info earlier.

* gcc.dg/pr95580.c: Disable DSE.
* gcc.dg/Wrestrict-8.c: Place a use after each memcpy.
* c-c++-common/ubsan/overflow-negate-3.c: Make asms volatile
to prevent them from being removed.
* c-c++-common/ubsan/overflow-sub-4.c: Likewise.
gcc/testsuite/c-c++-common/ubsan/overflow-negate-3.c
gcc/testsuite/c-c++-common/ubsan/overflow-sub-4.c
gcc/testsuite/gcc.dg/Wrestrict-8.c
gcc/testsuite/gcc.dg/pr95580.c
gcc/tree-ssa-dse.c
This page took 0.074644 seconds and 6 git commands to generate.