]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgcleanup: Remove check on available dominator information in remove_forwarder_block
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 10 Nov 2025 00:13:05 +0000 (16:13 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Thu, 13 Nov 2025 20:56:52 +0000 (12:56 -0800)
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 <andrew.pinski@oss.qualcomm.com>
gcc/tree-cfgcleanup.cc

index cc0838d8c4c789239dec7442c480d44afe551389..c2476b15af8ecffddfa3bd3832ada43445dfa17c 100644 (file)
@@ -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.  */