From: Andrew Pinski Date: Fri, 14 Nov 2025 01:27:06 +0000 (-0800) Subject: dce: Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT in simple_dce_from_wo... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8eb7d8dbb9ff4eb13f476b16f8f58103cace64e;p=thirdparty%2Fgcc.git dce: Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT in simple_dce_from_worklist When I wrote this code I forgot about FOR_EACH_IMM_USE_FAST. Since this code does not change any of the uses inside of the loop using FOR_EACH_IMM_USE_FAST will be slightly faster. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-dce.cc (simple_dce_from_worklist): Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT. Signed-off-by: Andrew Pinski --- diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index 53bbd7584fd..317a0d6179b 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -2378,12 +2378,13 @@ simple_dce_from_worklist (bitmap worklist, bitmap need_eh_cleanup) if (gimple_code (def_stmt) != GIMPLE_PHI) continue; - gimple *use_stmt; imm_use_iterator use_iter; + use_operand_p use_p; bool canremove = true; - FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, def) + FOR_EACH_IMM_USE_FAST (use_p, use_iter, def) { + gimple *use_stmt = USE_STMT (use_p); /* Ignore debug statements. */ if (is_gimple_debug (use_stmt)) continue;