]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/108353 - copyprop iteration order
authorRichard Biener <rguenther@suse.de>
Wed, 11 Jan 2023 08:32:36 +0000 (09:32 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 11 Jan 2023 10:53:12 +0000 (11:53 +0100)
commit445a48a226ffd530b37bcdc13b6bdca94ba2e122
tree329c6bacb8d70606446b65986cef97573de4e502
parent2ce074a7f858a1cd30ff68ec636dad9be218e04b
tree-optimization/108353 - copyprop iteration order

After recent improvements to copyprop to catch more constants
it shows that the current iteration order prefering forward
progress over iterating doesn't make much sense for an SSA
propagator.  The following instead first iterates cycles which
makes sure to not start with optimistically constant PHIs out
of cycles that optimistically do not exit.

PR tree-optimization/108353
* tree-ssa-propagate.cc (cfg_blocks_back, ssa_edge_worklist_back):
Remove.
(add_ssa_edge): Simplify.
(add_control_edge): Likewise.
(ssa_prop_init): Likewise.
(ssa_prop_fini): Likewise.
(ssa_propagation_engine::ssa_propagate): Likewise.

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