]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid scanning all stmts outside of loops in LIM
authorRichard Biener <rguenther@suse.de>
Mon, 17 Nov 2025 08:56:13 +0000 (09:56 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 17 Nov 2025 12:09:43 +0000 (13:09 +0100)
The following avoids scanning stmts outside of loops for possibly
not returning calls.

* tree-ssa-loop-im.cc (fill_always_executed_in): Skip
blocks not in loops when looking for possibly not returning
calls.

gcc/tree-ssa-loop-im.cc

index 0340857058bb76a7fe8be664af2d5d1943333259..4c0a46f93e63e8b3fbd9cf1621c53d5604045e3c 100644 (file)
@@ -3534,6 +3534,12 @@ fill_always_executed_in (void)
   bitmap_clear (contains_call);
   FOR_EACH_BB_FN (bb, cfun)
     {
+      if (loop_depth (bb->loop_father) == 0)
+       {
+         /* Outside of loops we can skip scanning all stmts.  */
+         bitmap_set_bit (contains_call, bb->index);
+         continue;
+       }
       gimple_stmt_iterator gsi;
       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
        {