https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109279
--- Comment #3 from Vineet Gupta <vineet.gupta at linux dot dev> ---
We start off with following:
(insn 18 17 19 2 (set (reg:DI 154)
(mem/u/c:DI (reg/f:DI 155) [0 S8 A64])) "...":9:8 179 {*movdi_64bit}
(expr_list:REG_DEAD (reg/f:DI 155)
(expr_list:REG_EQUAL (const_int [0x101010101010101])
cse1 matches the new pattern and converts mem to const_int.
(insn 18 17 19 2 (set (reg:DI 154)
(const_int [0x101010101010101])) "...":9:8 177 {*mvconst_internal}
(expr_list:REG_DEAD (reg/f:DI 155)
(expr_list:REG_EQUAL (const_int [0x101010101010101])
split1 then does its job, again using the introduced define_insn_and_split
"*mvconst_internal"
Splitting with gen_split_15 (riscv.md:1677)
deleting insn with uid = 18.
(insn 47 15 48 2 (set (reg:DI 154)
(const_int 16842752 [0x1010000])) "...":9:8 -1
(insn 48 47 49 2 (set (reg:DI 154)
(plus:DI (reg:DI 154)
(const_int 257 [0x101]))) "...":9:8 -1
(insn 49 48 50 2 (set (reg:DI 154)
(ashift:DI (reg:DI 154)
(const_int 16 [0x10]))) "...":9:8 -1
(insn 50 49 51 2 (set (reg:DI 154)
(plus:DI (reg:DI 154)
(const_int 257 [0x101]))) "...":9:8 -1
(insn 51 50 52 2 (set (reg:DI 154)
(ashift:DI (reg:DI 154)
(const_int 16 [0x10]))) "...":9:8 -1
(insn 52 51 19 2 (set (reg:DI 154)
(plus:DI (reg:DI 154)
(const_int 257 [0x101]))) "...":9:8 -1
(expr_list:REG_EQUAL (const_int [0x101010101010101])