m68k: replace reload_in_progress by reload_in_progress || lra_in_progress

For now assume that LRA needs the same treatment as reload.

	* config/m68k/m68k.md ("movsi", "movxf"): Replace
	reload_in_progress by reload_in_progress || lra_in_progress.
	* config/m68k/m68k.cc (m68k_legitimate_mem_p)
	(emit_move_sequence): Likewise.
	* config/m68k/predicates.md ("fp_src_operand"): Likewise.
This commit is contained in:
Andreas Schwab 2024-10-11 10:28:38 +02:00
parent 1506027347
commit f0f11559d5
3 changed files with 20 additions and 11 deletions

View file

@ -2352,7 +2352,8 @@ m68k_legitimate_mem_p (rtx x, struct m68k_address *address)
{
return (MEM_P (x)
&& m68k_decompose_address (GET_MODE (x), XEXP (x, 0),
reload_in_progress || reload_completed,
(reload_in_progress || lra_in_progress
|| reload_completed),
address));
}
@ -3899,11 +3900,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
rtx tem;
if (scratch_reg
&& reload_in_progress && GET_CODE (operand0) == REG
&& (reload_in_progress || lra_in_progress)
&& GET_CODE (operand0) == REG
&& REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
operand0 = reg_equiv_mem (REGNO (operand0));
else if (scratch_reg
&& reload_in_progress && GET_CODE (operand0) == SUBREG
&& (reload_in_progress || lra_in_progress)
&& GET_CODE (operand0) == SUBREG
&& GET_CODE (SUBREG_REG (operand0)) == REG
&& REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER)
{
@ -3916,11 +3919,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
}
if (scratch_reg
&& reload_in_progress && GET_CODE (operand1) == REG
&& (reload_in_progress || lra_in_progress)
&& GET_CODE (operand1) == REG
&& REGNO (operand1) >= FIRST_PSEUDO_REGISTER)
operand1 = reg_equiv_mem (REGNO (operand1));
else if (scratch_reg
&& reload_in_progress && GET_CODE (operand1) == SUBREG
&& (reload_in_progress || lra_in_progress)
&& GET_CODE (operand1) == SUBREG
&& GET_CODE (SUBREG_REG (operand1)) == REG
&& REGNO (SUBREG_REG (operand1)) >= FIRST_PSEUDO_REGISTER)
{
@ -3932,11 +3937,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
operand1 = alter_subreg (&temp, true);
}
if (scratch_reg && reload_in_progress && GET_CODE (operand0) == MEM
if (scratch_reg && (reload_in_progress || lra_in_progress)
&& GET_CODE (operand0) == MEM
&& ((tem = find_replacement (&XEXP (operand0, 0)))
!= XEXP (operand0, 0)))
operand0 = gen_rtx_MEM (GET_MODE (operand0), tem);
if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM
if (scratch_reg && (reload_in_progress || lra_in_progress)
&& GET_CODE (operand1) == MEM
&& ((tem = find_replacement (&XEXP (operand1, 0)))
!= XEXP (operand1, 0)))
operand1 = gen_rtx_MEM (GET_MODE (operand1), tem);

View file

@ -957,11 +957,12 @@
/* The source is an address which requires PIC relocation.
Call legitimize_pic_address with the source, mode, and a relocation
register (a new pseudo, or the final destination if reload_in_progress
is set). Then fall through normally */
rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
or lra_in_progress is set). Then fall through normally */
rtx temp = ((reload_in_progress || lra_in_progress)
? operands[0] : gen_reg_rtx (Pmode));
operands[1] = legitimize_pic_address (operands[1], SImode, temp);
}
else if (flag_pic && TARGET_PCREL && ! reload_in_progress)
else if (flag_pic && TARGET_PCREL && ! (reload_in_progress || lra_in_progress))
{
/* Don't allow writes to memory except via a register;
the m68k doesn't consider PC-relative addresses to be writable. */
@ -1452,7 +1453,7 @@
""
{
/* We can't rewrite operands during reload. */
if (! reload_in_progress)
if (! (reload_in_progress || lra_in_progress))
{
if (CONSTANT_P (operands[1]))
{

View file

@ -237,6 +237,7 @@
|| (TARGET_68881
&& (!standard_68881_constant_p (op)
|| reload_in_progress
|| lra_in_progress
|| reload_completed)));
})