Skip to content

Commit bb74c33

Browse files
artemiy-volkovMichielDerhaeg
authored andcommitted
arcv: fuse load-immediate with store
For the RMX-500 and RHX cores, the sequence "load-immediate + store" (that is used to store a constant value) can be executed in 1 cycle, provided the two instructions are kept next to one another. This patch handles this case in riscv_macro_fusion_pair_p(). Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
1 parent 9225a85 commit bb74c33

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gcc/config/riscv/riscv.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10489,6 +10489,16 @@ arcv_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr)
1048910489
return true;
1049010490
}
1049110491

10492+
/* Fuse load-immediate with a store of the destination register. */
10493+
if (get_attr_type (prev) == TYPE_MOVE
10494+
&& get_attr_move_type (prev) == MOVE_TYPE_CONST
10495+
&& get_attr_type (curr) == TYPE_STORE
10496+
&& ((REG_P (SET_SRC (curr_set))
10497+
&& SET_DEST (prev_set) == SET_SRC (curr_set))
10498+
|| (SUBREG_P (SET_SRC (curr_set))
10499+
&& SET_DEST (prev_set) == SUBREG_REG (SET_SRC (curr_set)))))
10500+
return true;
10501+
1049210502
return false;
1049310503
}
1049410504

0 commit comments

Comments
 (0)