aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJiufu Guo <guojiufu@linux.ibm.com>2022-12-09 13:50:37 +0800
committerJiufu Guo <guojiufu@linux.ibm.com>2022-12-09 19:19:39 +0800
commit71b31d13757ae0f544651c29b113ccf120573760 (patch)
treed5db2dbc11f6943119103a3aa5eb28f4653cfaf0 /gcc
parent96cb786b754919f41dc7de9566a68ed25a4bf3fa (diff)
downloadgcc-71b31d13757ae0f544651c29b113ccf120573760.zip
gcc-71b31d13757ae0f544651c29b113ccf120573760.tar.gz
gcc-71b31d13757ae0f544651c29b113ccf120573760.tar.bz2
rs6000: Remove useless copy_rtx in rs6000_emit_set_{,long}_const
Function rs6000_emit_set_const/rs6000_emit_set_long_const are only invoked from two "define_split"s where the target operand is limited to gpc_reg_operand or int_reg_operand, then the operand must be REG_P. And in rs6000_emit_set_const/rs6000_emit_set_long_const, to create temp rtx, it is using code like "gen_reg_rtx({S|D}Imode)", it must also be REG_P. So, copy_rtx is not needed for temp and dest. This patch removes those "copy_rtx" for rs6000_emit_set_const and rs6000_emit_set_long_const. gcc/ChangeLog: * config/rs6000/rs6000.cc (rs6000_emit_set_const): Remove copy_rtx. (rs6000_emit_set_long_const): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/rs6000/rs6000.cc61
1 files changed, 21 insertions, 40 deletions
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 70a3ca8..b3a609f 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -10186,10 +10186,9 @@ rs6000_emit_set_const (rtx dest, rtx source)
case E_SImode:
temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (SImode);
- emit_insn (gen_rtx_SET (copy_rtx (temp),
- GEN_INT (c & ~(HOST_WIDE_INT) 0xffff)));
+ emit_insn (gen_rtx_SET (temp, GEN_INT (c & ~(HOST_WIDE_INT) 0xffff)));
emit_insn (gen_rtx_SET (dest,
- gen_rtx_IOR (SImode, copy_rtx (temp),
+ gen_rtx_IOR (SImode, temp,
GEN_INT (c & 0xffff))));
break;
@@ -10198,10 +10197,8 @@ rs6000_emit_set_const (rtx dest, rtx source)
{
rtx hi, lo;
- hi = operand_subword_force (copy_rtx (dest), WORDS_BIG_ENDIAN == 0,
- DImode);
- lo = operand_subword_force (dest, WORDS_BIG_ENDIAN != 0,
- DImode);
+ hi = operand_subword_force (dest, WORDS_BIG_ENDIAN == 0, DImode);
+ lo = operand_subword_force (dest, WORDS_BIG_ENDIAN != 0, DImode);
emit_move_insn (hi, GEN_INT (c >> 32));
c = sext_hwi (c, 32);
emit_move_insn (lo, GEN_INT (c));
@@ -10249,27 +10246,22 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c)
{
temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode);
- emit_move_insn (ud1 != 0 ? copy_rtx (temp) : dest,
+ emit_move_insn (ud1 != 0 ? temp : dest,
GEN_INT (sext_hwi (ud2 << 16, 32)));
if (ud1 != 0)
- emit_move_insn (dest,
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud1)));
+ emit_move_insn (dest, gen_rtx_IOR (DImode, temp, GEN_INT (ud1)));
}
else if (ud3 == 0 && ud4 == 0)
{
temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode);
gcc_assert (ud2 & 0x8000);
- emit_move_insn (copy_rtx (temp), GEN_INT (sext_hwi (ud2 << 16, 32)));
+ emit_move_insn (temp, GEN_INT (sext_hwi (ud2 << 16, 32)));
if (ud1 != 0)
- emit_move_insn (copy_rtx (temp),
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud1)));
+ emit_move_insn (temp, gen_rtx_IOR (DImode, temp, GEN_INT (ud1)));
emit_move_insn (dest,
gen_rtx_ZERO_EXTEND (DImode,
- gen_lowpart (SImode,
- copy_rtx (temp))));
+ gen_lowpart (SImode,temp)));
}
else if (ud1 == ud3 && ud2 == ud4)
{
@@ -10285,18 +10277,13 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c)
{
temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode);
- emit_move_insn (copy_rtx (temp), GEN_INT (sext_hwi (ud3 << 16, 32)));
+ emit_move_insn (temp, GEN_INT (sext_hwi (ud3 << 16, 32)));
if (ud2 != 0)
- emit_move_insn (copy_rtx (temp),
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud2)));
- emit_move_insn (ud1 != 0 ? copy_rtx (temp) : dest,
- gen_rtx_ASHIFT (DImode, copy_rtx (temp),
- GEN_INT (16)));
+ emit_move_insn (temp, gen_rtx_IOR (DImode, temp, GEN_INT (ud2)));
+ emit_move_insn (ud1 != 0 ? temp : dest,
+ gen_rtx_ASHIFT (DImode, temp, GEN_INT (16)));
if (ud1 != 0)
- emit_move_insn (dest,
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud1)));
+ emit_move_insn (dest, gen_rtx_IOR (DImode, temp, GEN_INT (ud1)));
}
else if (TARGET_PREFIXED)
{
@@ -10337,23 +10324,17 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c)
{
temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode);
- emit_move_insn (copy_rtx (temp), GEN_INT (sext_hwi (ud4 << 16, 32)));
+ emit_move_insn (temp, GEN_INT (sext_hwi (ud4 << 16, 32)));
if (ud3 != 0)
- emit_move_insn (copy_rtx (temp),
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud3)));
+ emit_move_insn (temp, gen_rtx_IOR (DImode, temp, GEN_INT (ud3)));
- emit_move_insn (ud2 != 0 || ud1 != 0 ? copy_rtx (temp) : dest,
- gen_rtx_ASHIFT (DImode, copy_rtx (temp),
- GEN_INT (32)));
+ emit_move_insn (ud2 != 0 || ud1 != 0 ? temp : dest,
+ gen_rtx_ASHIFT (DImode, temp, GEN_INT (32)));
if (ud2 != 0)
- emit_move_insn (ud1 != 0 ? copy_rtx (temp) : dest,
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud2 << 16)));
+ emit_move_insn (ud1 != 0 ? temp : dest,
+ gen_rtx_IOR (DImode, temp, GEN_INT (ud2 << 16)));
if (ud1 != 0)
- emit_move_insn (dest,
- gen_rtx_IOR (DImode, copy_rtx (temp),
- GEN_INT (ud1)));
+ emit_move_insn (dest, gen_rtx_IOR (DImode, temp, GEN_INT (ud1)));
}
}