]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/114855 - high update_ssa time
authorRichard Biener <rguenther@suse.de>
Mon, 23 Sep 2024 13:41:14 +0000 (15:41 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Sep 2024 06:46:27 +0000 (08:46 +0200)
commitf9dfe8dea31bf5c56aa7798a0905707faf9e7ec4
tree38dcf21c60c5cc936a53596a566cf63c198c351c
parent824229e38662b5921e156d0fcbd7180462ba9d60
tree-optimization/114855 - high update_ssa time

Part of the problem in PR114855 is high update_ssa time.  When one fixes
the backward jump threading issue tree SSA incremental is at
439.91s ( 26%), mostly doing bitmap element searches for
blocks_with_phis_to_rewrite.  The following turns that bitmap to tree
view noticing the two-dimensional vector of PHIs it guards is excessive
compared to what we actually save with it - walking all PHI nodes
in a block, something we already do once to initialize stmt flags.
So instead of optimizing that walk we use the stmt flag, saving
allocations and global state that lives throughout the whole
compilation.

This reduces the tree SSA incremental time to 203.13 ( 14%)

The array was added in r0-74758-g2ce798794df8e1 when we still possibly
had gazillion virtual operands for PR26830, I checked the testcase
still behaves OK.

PR tree-optimization/114855
* tree-into-ssa.cc (phis_to_rewrite): Remove global var.
(mark_phi_for_rewrite): Simplify.
(rewrite_update_phi_arguments): Walk all PHIs, process
those satisfying rewrite_uses_p.
(delete_update_ssa): Simplify.
(update_ssa): Likewise.  Switch blocks_with_phis_to_rewrite
to tree view.
gcc/tree-into-ssa.cc