https://gcc.gnu.org/g:35874595799c045dcbe81944d830a19d3c8a5d93
commit r17-4053-g35874595799c045dcbe81944d830a19d3c8a5d93 Author: Kyrylo Tkachov <[email protected]> Date: Wed Jul 22 17:59:45 2026 +0200 ifcvt: decode the multiple-sets condition once noce_convert_multiple_sets decodes the jump condition with noce_get_condition and then calls noce_convert_multiple_sets_1 twice, each call decoding the very same condition again into a cond_earliest local that it never reads. Pass the already-decoded condition into the helper and drop the repeated decode and the dead local. No functional change. gcc/ChangeLog: * ifcvt.cc (noce_convert_multiple_sets_1): Take the condition as a parameter instead of re-decoding it. Remove the unused cond_earliest local. (noce_convert_multiple_sets): Pass the decoded condition down. Signed-off-by: Kyrylo Tkachov <[email protected]> Diff: --- gcc/ifcvt.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index 5a731851d51c..9a2b28c4747b 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -111,7 +111,7 @@ static void noce_emit_move_insn (rtx, rtx); static rtx_insn *block_has_only_trap (basic_block); static void init_noce_multiple_sets_info (basic_block, auto_delete_vec<noce_multiple_sets_info> &); -static bool noce_convert_multiple_sets_1 (struct noce_if_info *, +static bool noce_convert_multiple_sets_1 (noce_if_info *, rtx, auto_delete_vec<noce_multiple_sets_info> &, auto_delete_vec<noce_multiple_sets_info> &, unsigned, const vec<unsigned> &, int *, bool *); @@ -4190,7 +4190,7 @@ noce_convert_multiple_sets (struct noce_if_info *if_info) bool use_cond_earliest = false; bool ok = noce_convert_multiple_sets_1 - (if_info, insn_info, else_insn_info, then_count, else_only_indices, + (if_info, cond, insn_info, else_insn_info, then_count, else_only_indices, &last_needs_comparison, &use_cond_earliest); if (!ok) return false; @@ -4203,7 +4203,7 @@ noce_convert_multiple_sets (struct noce_if_info *if_info) end_sequence (); start_sequence (); ok = noce_convert_multiple_sets_1 - (if_info, insn_info, else_insn_info, then_count, else_only_indices, + (if_info, cond, insn_info, else_insn_info, then_count, else_only_indices, &last_needs_comparison, &use_cond_earliest); /* Actually we should not fail anymore if we reached here, @@ -4299,7 +4299,7 @@ noce_convert_multiple_sets (struct noce_if_info *if_info) emitted. */ static bool -noce_convert_multiple_sets_1 (struct noce_if_info *if_info, +noce_convert_multiple_sets_1 (noce_if_info *if_info, rtx cond, auto_delete_vec<noce_multiple_sets_info> &insn_info, auto_delete_vec<noce_multiple_sets_info> &else_insn_info, @@ -4309,10 +4309,6 @@ noce_convert_multiple_sets_1 (struct noce_if_info *if_info, bool *use_cond_earliest) { rtx_insn *jump = if_info->jump; - rtx_insn *cond_earliest; - - /* Decompose the condition attached to the jump. */ - rtx cond = noce_get_condition (jump, &cond_earliest, false); rtx cc_cmp = cond_exec_get_condition (jump); if (cc_cmp)
