https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118638
--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Sam James from comment #5)
> I think it's going to be r14-4810-ge28869670c9879.
There is nothing wrong with the splitter from the above commit, but the pattern
enables quite some creative combinations from th combine pass:
Trying 6 -> 7:
6: {r107:SI=r106:SI-0x9;clobber flags:CC;}
REG_UNUSED flags:CC
7: {r108:SI=r107:SI+r106:SI;clobber flags:CC;}
REG_DEAD r107:SI
REG_UNUSED flags:CC
Successfully matched this instruction:
(set (reg:SI 108 [ tt_5 ])
(plus:SI (ashift:SI (reg/v:SI 106 [ a ])
(const_int 1 [0x1]))
(const_int -9 [0xfffffffffffffff7])))
allowing combination of insns 6 and 7
Trying 7 -> 13:
7: r108:SI=r106:SI<<0x1-0x9
13: {r101:SI=r108:SI+r109:SI;clobber flags:CC;}
REG_DEAD r109:SI
REG_DEAD r108:SI
REG_UNUSED flags:CC
Successfully matched this instruction:
(set (reg/v:SI 101 [ t ])
(plus:SI (plus:SI (ashift:SI (reg/v:SI 106 [ a ])
(const_int 1 [0x1]))
(reg:SI 109 [ _11 ]))
(const_int -9 [0xfffffffffffffff7])))
allowing combination of insns 7 and 13
Trying 15 -> 16:
15: {r113:SI=r112:SI&0x1;clobber flags:CC;}
REG_DEAD r112:SI
REG_UNUSED flags:CC
16: {r111:SI=-r113:SI;clobber flags:CC;}
REG_DEAD r113:SI
REG_UNUSED flags:CC
Successfully matched this instruction:
(parallel [
(set (reg:SI 111 [ _9 ])
(sign_extract:SI (reg:SI 112 [ t_7 ])
(const_int 1 [0x1])
(const_int 0 [0])))
(clobber (reg:CC 17 flags))
])
allowing combination of insns 15 and 16
Trying 13, 14 -> 16:
13: r101:SI=r106:SI<<0x1+r109:SI-0x9
REG_DEAD r106:SI
REG_DEAD r109:SI
14: r112:SI=~r101:SI
REG_DEAD r101:SI
16: {r111:SI=sign_extract(r112:SI,0x1,0);clobber flags:CC;}
REG_DEAD r112:SI
REG_UNUSED flags:CC
Successfully matched this instruction:
(parallel [
(set (reg:SI 111 [ _9 ])
(sign_extract:SI (reg:SI 109 [ _11 ])
(const_int 1 [0x1])
(const_int 0 [0])))
(clobber (reg:CC 17 flags))
])
allowing combination of insns 13, 14 and 16
Trying 11, 12 -> 16:
11: r109:SI=flags:CCZ!=0
REG_DEAD flags:CCZ
12: r109:SI=r109:SI*0x2+r109:SI
16: {r111:SI=sign_extract(r109:SI,0x1,0);clobber flags:CC;}
REG_DEAD r109:SI
REG_UNUSED flags:CC
Failed to match this instruction:
(parallel [
(set (reg:SI 111 [ _9 ])
(mult:SI (ne:SI (reg:CCZ 17 flags)
(const_int 0 [0]))
(const_int 3 [0x3])))
(clobber (reg:CC 17 flags))
])
Successfully matched this instruction:
(set (reg:SI 109 [ _11 ])
(ne:SI (reg:CCZ 17 flags)
(const_int 0 [0])))
Successfully matched this instruction:
(set (reg:SI 111 [ _9 ])
(mult:SI (reg:SI 109 [ _11 ])
(const_int 3 [0x3])))
allowing combination of insns 11, 12 and 16