]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dce: Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT in simple_dce_from_wo...
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 14 Nov 2025 01:27:06 +0000 (17:27 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 19 Nov 2025 17:14:04 +0000 (09:14 -0800)
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 <andrew.pinski@oss.qualcomm.com>
gcc/tree-ssa-dce.cc

index 53bbd7584fd80f90c1af93aca03c1bf5c67ab971..317a0d6179b3b30fdb2051ed996b91809e0c35c5 100644 (file)
@@ -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;