mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 12:55:12 +08:00
regclass.c (scan_one_insn): Remove splitting of two address insns.
* regclass.c (scan_one_insn): Remove splitting of two address insns. From-SVN: r124277
This commit is contained in:
parent
e739dfac3c
commit
88250695a7
@ -1,3 +1,8 @@
|
||||
2007-04-29 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* regclass.c (scan_one_insn): Remove splitting of
|
||||
two address insns.
|
||||
|
||||
2007-04-28 Sandra Loosemore <sandra@codesourcery.com>
|
||||
Nigel Stephens <nigel@mips.com>
|
||||
|
||||
|
@ -1029,7 +1029,7 @@ record_operand_costs (rtx insn, struct costs *op_costs,
|
||||
there. */
|
||||
|
||||
static rtx
|
||||
scan_one_insn (rtx insn, int pass)
|
||||
scan_one_insn (rtx insn, int pass ATTRIBUTE_UNUSED)
|
||||
{
|
||||
enum rtx_code pat_code;
|
||||
rtx set, note;
|
||||
@ -1069,68 +1069,6 @@ scan_one_insn (rtx insn, int pass)
|
||||
return insn;
|
||||
}
|
||||
|
||||
/* Improve handling of two-address insns such as
|
||||
(set X (ashift CONST Y)) where CONST must be made to
|
||||
match X. Change it into two insns: (set X CONST)
|
||||
(set X (ashift X Y)). If we left this for reloading, it
|
||||
would probably get three insns because X and Y might go
|
||||
in the same place. This prevents X and Y from receiving
|
||||
the same hard reg.
|
||||
|
||||
We can only do this if the modes of operands 0 and 1
|
||||
(which might not be the same) are tieable and we only need
|
||||
do this during our first pass. */
|
||||
|
||||
if (pass == 0 && optimize
|
||||
&& recog_data.n_operands >= 3
|
||||
&& recog_data.constraints[1][0] == '0'
|
||||
&& recog_data.constraints[1][1] == 0
|
||||
&& CONSTANT_P (recog_data.operand[1])
|
||||
&& ! rtx_equal_p (recog_data.operand[0], recog_data.operand[1])
|
||||
&& ! rtx_equal_p (recog_data.operand[0], recog_data.operand[2])
|
||||
&& REG_P (recog_data.operand[0])
|
||||
&& MODES_TIEABLE_P (GET_MODE (recog_data.operand[0]),
|
||||
recog_data.operand_mode[1]))
|
||||
{
|
||||
rtx previnsn = prev_real_insn (insn);
|
||||
rtx dest
|
||||
= gen_lowpart (recog_data.operand_mode[1],
|
||||
recog_data.operand[0]);
|
||||
rtx newinsn
|
||||
= emit_insn_before (gen_move_insn (dest, recog_data.operand[1]), insn);
|
||||
|
||||
/* If this insn was the start of a basic block,
|
||||
include the new insn in that block.
|
||||
We need not check for code_label here;
|
||||
while a basic block can start with a code_label,
|
||||
INSN could not be at the beginning of that block. */
|
||||
if (previnsn == 0 || JUMP_P (previnsn))
|
||||
{
|
||||
basic_block b;
|
||||
FOR_EACH_BB (b)
|
||||
if (insn == BB_HEAD (b))
|
||||
BB_HEAD (b) = newinsn;
|
||||
}
|
||||
|
||||
/* This makes one more setting of new insns's dest. */
|
||||
REG_N_SETS (REGNO (recog_data.operand[0]))++;
|
||||
REG_N_REFS (REGNO (recog_data.operand[0]))++;
|
||||
REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
|
||||
|
||||
*recog_data.operand_loc[1] = recog_data.operand[0];
|
||||
REG_N_REFS (REGNO (recog_data.operand[0]))++;
|
||||
REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
|
||||
for (i = recog_data.n_dups - 1; i >= 0; i--)
|
||||
if (recog_data.dup_num[i] == 1)
|
||||
{
|
||||
*recog_data.dup_loc[i] = recog_data.operand[0];
|
||||
REG_N_REFS (REGNO (recog_data.operand[0]))++;
|
||||
REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
|
||||
}
|
||||
|
||||
return PREV_INSN (newinsn);
|
||||
}
|
||||
|
||||
record_operand_costs (insn, op_costs, reg_pref);
|
||||
|
||||
/* Now add the cost for each operand to the total costs for
|
||||
|
Loading…
Reference in New Issue
Block a user