From: Richard Biener Date: Mon, 17 Nov 2025 08:56:13 +0000 (+0100) Subject: Avoid scanning all stmts outside of loops in LIM X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc36c54845c23b64899de754e70f862cab2478ad;p=thirdparty%2Fgcc.git Avoid scanning all stmts outside of loops in LIM 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. --- diff --git a/gcc/tree-ssa-loop-im.cc b/gcc/tree-ssa-loop-im.cc index 0340857058b..4c0a46f93e6 100644 --- a/gcc/tree-ssa-loop-im.cc +++ b/gcc/tree-ssa-loop-im.cc @@ -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)) {