https://gcc.gnu.org/g:f76083cf1522069440e907720584928023014325
commit r16-5253-gf76083cf1522069440e907720584928023014325 Author: Andrew Pinski <[email protected]> Date: Sun Nov 9 16:13:05 2025 -0800 cfgcleanup: Remove check on available dominator information in remove_forwarder_block Since at least r9-1005-gb401e50fed4def, dominator information is available in remove_forwarder_block so there is no reason to have a check on if we should update the dominator information, always do it. This is one more step into commoning remove_forwarder_block and remove_forwarder_block_with_phi. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-cfgcleanup.cc (remove_forwarder_block): Remove check on the available dominator information. Signed-off-by: Andrew Pinski <[email protected]> Diff: --- gcc/tree-cfgcleanup.cc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/gcc/tree-cfgcleanup.cc b/gcc/tree-cfgcleanup.cc index cc0838d8c4c7..c2476b15af8e 100644 --- a/gcc/tree-cfgcleanup.cc +++ b/gcc/tree-cfgcleanup.cc @@ -719,23 +719,20 @@ remove_forwarder_block (basic_block bb) bitmap_set_bit (cfgcleanup_altered_bbs, dest->index); /* Update the dominators. */ - if (dom_info_available_p (CDI_DOMINATORS)) - { - basic_block dom, dombb, domdest; - - dombb = get_immediate_dominator (CDI_DOMINATORS, bb); - domdest = get_immediate_dominator (CDI_DOMINATORS, dest); - if (domdest == bb) - { - /* Shortcut to avoid calling (relatively expensive) - nearest_common_dominator unless necessary. */ - dom = dombb; - } - else - dom = nearest_common_dominator (CDI_DOMINATORS, domdest, dombb); + basic_block dom, dombb, domdest; - set_immediate_dominator (CDI_DOMINATORS, dest, dom); + dombb = get_immediate_dominator (CDI_DOMINATORS, bb); + domdest = get_immediate_dominator (CDI_DOMINATORS, dest); + if (domdest == bb) + { + /* Shortcut to avoid calling (relatively expensive) + nearest_common_dominator unless necessary. */ + dom = dombb; } + else + dom = nearest_common_dominator (CDI_DOMINATORS, domdest, dombb); + + set_immediate_dominator (CDI_DOMINATORS, dest, dom); /* Adjust latch infomation of BB's parent loop as otherwise the cfg hook has a hard time not to kill the loop. */
