]> git.ipfire.org Git - thirdparty/gcc.git/commit
ifcombine across noncontiguous blocks
authorAlexandre Oliva <oliva@adacore.com>
Thu, 7 Nov 2024 05:47:42 +0000 (02:47 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 7 Nov 2024 05:47:42 +0000 (02:47 -0300)
commitae074c69fd5aff10953264dbd9740cebfeb0902e
treeecab4badc35358deee858683b5c9c1840c94b6c4
parent6eac478619193eeb2fd714eb0988ce3197dd63b1
ifcombine across noncontiguous blocks

Rework ifcombine to support merging conditions from noncontiguous
blocks.  This depends on earlier preparation changes.

The function that attempted to ifcombine a block with its immediate
predecessor, tree_ssa_ifcombine_bb, now loops over dominating blocks
eligible for ifcombine, attempting to combine with them.

The function that actually drives the combination of a pair of blocks,
tree_ssa_ifcombine_bb_1, now takes an additional parameter: the
successor of outer that leads to inner.

The function that recognizes if_then_else patterns is modified to
enable testing without distinguishing between then and else, or to
require nondegenerate conditions, that aren't worth combining with.

for  gcc/ChangeLog

* tree-ssa-ifcombine.cc (recognize_if_then_else): Support
relaxed then/else testing; require nondegenerate condition
otherwise.
(tree_ssa_ifcombine_bb_1): Add outer_succ_bb parm, use it
instead of inner_cond_bb.  Adjust callers.
(tree_ssa_ifcombine_bb): Loop over dominating outer blocks
eligible for ifcombine.
(pass_tree_ifcombine::execute): Noted potential need for
changes to the post-combine logic.
gcc/tree-ssa-ifcombine.cc