On 3/28/25 5:20 AM, Jakub Jelinek wrote:
Hi!

Here is the incremental patch I was talking about.
For noop sets, we don't need to test much, they can go to i2
unless that would violate i3 JUMP condition.

With this the try_combine on the pr119291.c testcase doesn't fail,
but succeeds and we get
(insn 22 21 23 4 (set (pc)
         (pc)) "pr119291.c":27:15 2147483647 {NOOP_MOVE}
      (nil))
(insn 23 22 24 4 (set (reg/v:SI 117 [ e ])
         (reg/v:SI 116 [ e ])) 96 {*movsi_internal}
      (expr_list:REG_DEAD (reg/v:SI 116 [ e ])
         (nil)))
(note 24 23 25 4 NOTE_INSN_DELETED)
(insn 25 24 26 4 (set (reg/v:SI 116 [ e ])
         (const_int 0 [0])) "pr119291.c":28:13 96 {*movsi_internal}
      (nil))
(note 26 25 27 4 NOTE_INSN_DELETED)
(insn 27 26 28 4 (set (reg:DI 128 [ _9 ])
         (const_int 0 [0])) "pr119291.c":28:13 95 {*movdi_internal}
      (nil))
after it.

Ok for trunk if this passes bootstrap/regtest?

2025-03-28  Jakub Jelinek  <ja...@redhat.com>

        * combine.cc (try_combine): Sets which satisfy set_noop_p can go
        to i2 unless i3 is a jump and the other set is not.
Shouldn't this wait for gcc-16? Or can you make a reasonable case that the nop moves constitute a code quality regression? OK for gcc-16. OK for gcc-15 is those nop moves are a code quality regression.

jeff

Reply via email to