From: Andrew Pinski Date: Fri, 27 Mar 2026 22:42:16 +0000 (-0700) Subject: phiprop: Move the check on vuse before the dominator tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2ded18d4fcc5d7d951a6bbc455dadbf5a837939;p=thirdparty%2Fgcc.git phiprop: Move the check on vuse before the dominator tests This again is some small optimization of the order of checks here. The dom tests don't say if the prop can happen any more so putting them after tests that will cause the prop not to happen is a good thing. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-phiprop.cc (propagate_with_phi): Move vuse checks before the dominator tests. Signed-off-by: Andrew Pinski --- diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc index 2ee67d6130b..873cff1c15e 100644 --- a/gcc/tree-ssa-phiprop.cc +++ b/gcc/tree-ssa-phiprop.cc @@ -385,6 +385,10 @@ propagate_with_phi (basic_block bb, gphi *vphi, gphi *phi, && !gimple_has_volatile_ops (use_stmt))) continue; + tree vuse = gimple_vuse (use_stmt); + if (!can_handle_load (use_stmt, bb, vphi, up_vuse)) + continue; + bool aggregate = false; if (!is_gimple_reg_type (TREE_TYPE (gimple_assign_lhs (use_stmt)))) aggregate = true; @@ -412,10 +416,6 @@ propagate_with_phi (basic_block bb, gphi *vphi, gphi *phi, gimple_bb (use_stmt)->loop_father))))) delay = true; - tree vuse = gimple_vuse (use_stmt); - if (!can_handle_load (use_stmt, bb, vphi, up_vuse)) - goto next; - /* Found a proper dereference with an aggregate copy. Just insert aggregate copies on the edges instead. */ if (aggregate)