]> git.ipfire.org Git - thirdparty/gcc.git/commit
combine: Special case set_noop_p in two spots
authorJakub Jelinek <jakub@redhat.com>
Thu, 1 May 2025 06:29:03 +0000 (08:29 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 1 May 2025 06:29:03 +0000 (08:29 +0200)
commit79aa2a283a8d3327ff4d6dca77e81d5b1ac3a01e
tree68bd344e06d75d5374ae7a75ac84da175196d2ad
parenta5d89deeaed7ba8ae42e262395a4cd31f878f3e8
combine: Special case set_noop_p in two spots

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.

2025-05-01  Jakub Jelinek  <jakub@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.
gcc/combine.cc