Commit 3cb8ee5c by Peter Bergner Committed by Peter Bergner

predicates.md (volatile_mem_operand): Remove code related to reload_in_progress.

	* config/rs6000/predicates.md (volatile_mem_operand): Remove code
	related to reload_in_progress.
	(splat_input_operand): Likewise.
	* config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_rtx):
	Delete prototype.
	* config/rs6000/rs6000.c (machine_function): Remove sdmode_stack_slot
	field.
	(TARGET_EXPAND_TO_RTL_HOOK): Delete.
	(TARGET_INSTANTIATE_DECLS): Likewise.
	(legitimate_indexed_address_p): Delete reload_in_progress code.
	(rs6000_debug_legitimate_address_p): Likewise.
	(rs6000_eliminate_indexed_memrefs): Likewise.
	(rs6000_emit_le_vsx_store): Likewise.
	(rs6000_emit_move_si_sf_subreg): Likewise.
	(rs6000_emit_move): Likewise.
	(register_to_reg_type): Likewise.
	(rs6000_pre_atomic_barrier): Likewise.
	(rs6000_machopic_legitimize_pic_address): Likewise.
	(rs6000_allocate_stack_temp): Likewise.
	(rs6000_address_for_fpconvert): Likewise.
	(rs6000_address_for_altivec): Likewise.
	(rs6000_secondary_memory_needed_rtx): Delete function.
	(rs6000_check_sdmode): Likewise.
	(rs6000_alloc_sdmode_stack_slot): Likewise.
	(rs6000_instantiate_decls): Likewise.
	* config/rs6000/rs6000.h (SECONDARY_MEMORY_NEEDED_RTX): Delete.
	* config/rs6000/rs6000.md (splitter for *movsi_got_internal):
	Delete reload_in_progress.
	(*vec_reload_and_plus_<mptrsize>): Likewise.
	* config/rs6000/vsx.md (vsx_mul_v2di): Likewise.
	(vsx_div_v2di): Likewise.
	(vsx_udiv_v2di): Likewise.

From-SVN: r250638
parent 7a5cbf29
2017-07-27 Peter Bergner <bergner@vnet.ibm.com> 2017-07-27 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/predicates.md (volatile_mem_operand): Remove code
related to reload_in_progress.
(splat_input_operand): Likewise.
* config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_rtx):
Delete prototype.
* config/rs6000/rs6000.c (machine_function): Remove sdmode_stack_slot
field.
(TARGET_EXPAND_TO_RTL_HOOK): Delete.
(TARGET_INSTANTIATE_DECLS): Likewise.
(legitimate_indexed_address_p): Delete reload_in_progress code.
(rs6000_debug_legitimate_address_p): Likewise.
(rs6000_eliminate_indexed_memrefs): Likewise.
(rs6000_emit_le_vsx_store): Likewise.
(rs6000_emit_move_si_sf_subreg): Likewise.
(rs6000_emit_move): Likewise.
(register_to_reg_type): Likewise.
(rs6000_pre_atomic_barrier): Likewise.
(rs6000_machopic_legitimize_pic_address): Likewise.
(rs6000_allocate_stack_temp): Likewise.
(rs6000_address_for_fpconvert): Likewise.
(rs6000_address_for_altivec): Likewise.
(rs6000_secondary_memory_needed_rtx): Delete function.
(rs6000_check_sdmode): Likewise.
(rs6000_alloc_sdmode_stack_slot): Likewise.
(rs6000_instantiate_decls): Likewise.
* config/rs6000/rs6000.h (SECONDARY_MEMORY_NEEDED_RTX): Delete.
* config/rs6000/rs6000.md (splitter for *movsi_got_internal):
Delete reload_in_progress.
(*vec_reload_and_plus_<mptrsize>): Likewise.
* config/rs6000/vsx.md (vsx_mul_v2di): Likewise.
(vsx_div_v2di): Likewise.
(vsx_udiv_v2di): Likewise.
2017-07-27 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/rs6000.opt (mlra): Replace with stub. * config/rs6000/rs6000.opt (mlra): Replace with stub.
* config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Delete OPTION_MASK_LRA. * config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Delete OPTION_MASK_LRA.
* config/rs6000/rs6000.c (TARGET_LRA_P): Delete. * config/rs6000/rs6000.c (TARGET_LRA_P): Delete.
......
...@@ -783,10 +783,8 @@ ...@@ -783,10 +783,8 @@
(and (and (match_code "mem") (and (and (match_code "mem")
(match_test "MEM_VOLATILE_P (op)")) (match_test "MEM_VOLATILE_P (op)"))
(if_then_else (match_test "reload_completed") (if_then_else (match_test "reload_completed")
(match_operand 0 "memory_operand") (match_operand 0 "memory_operand")
(if_then_else (match_test "reload_in_progress") (match_test "memory_address_p (mode, XEXP (op, 0))"))))
(match_test "strict_memory_address_p (mode, XEXP (op, 0))")
(match_test "memory_address_p (mode, XEXP (op, 0))")))))
;; Return 1 if the operand is an offsettable memory operand. ;; Return 1 if the operand is an offsettable memory operand.
(define_predicate "offsettable_mem_operand" (define_predicate "offsettable_mem_operand"
...@@ -1142,7 +1140,7 @@ ...@@ -1142,7 +1140,7 @@
if (! volatile_ok && MEM_VOLATILE_P (op)) if (! volatile_ok && MEM_VOLATILE_P (op))
return 0; return 0;
if (reload_in_progress || lra_in_progress || reload_completed) if (lra_in_progress || reload_completed)
return indexed_or_indirect_address (addr, vmode); return indexed_or_indirect_address (addr, vmode);
else else
return memory_address_addr_space_p (vmode, addr, MEM_ADDR_SPACE (op)); return memory_address_addr_space_p (vmode, addr, MEM_ADDR_SPACE (op));
......
...@@ -155,7 +155,6 @@ extern void rs6000_emit_le_vsx_permute (rtx, rtx, machine_mode); ...@@ -155,7 +155,6 @@ extern void rs6000_emit_le_vsx_permute (rtx, rtx, machine_mode);
extern void rs6000_emit_le_vsx_move (rtx, rtx, machine_mode); extern void rs6000_emit_le_vsx_move (rtx, rtx, machine_mode);
extern bool valid_sf_si_move (rtx, rtx, machine_mode); extern bool valid_sf_si_move (rtx, rtx, machine_mode);
extern void rs6000_emit_move (rtx, rtx, machine_mode); extern void rs6000_emit_move (rtx, rtx, machine_mode);
extern rtx rs6000_secondary_memory_needed_rtx (machine_mode);
extern machine_mode rs6000_secondary_memory_needed_mode (machine_mode); extern machine_mode rs6000_secondary_memory_needed_mode (machine_mode);
extern rtx (*rs6000_legitimize_reload_address_ptr) (rtx, machine_mode, extern rtx (*rs6000_legitimize_reload_address_ptr) (rtx, machine_mode,
int, int, int, int *); int, int, int, int *);
......
...@@ -143,10 +143,6 @@ typedef struct GTY(()) machine_function ...@@ -143,10 +143,6 @@ typedef struct GTY(()) machine_function
/* Offset from virtual_stack_vars_rtx to the start of the ABI_V4 /* Offset from virtual_stack_vars_rtx to the start of the ABI_V4
varargs save area. */ varargs save area. */
HOST_WIDE_INT varargs_save_offset; HOST_WIDE_INT varargs_save_offset;
/* Temporary stack slot to use for SDmode copies. This slot is
64-bits wide and is allocated early enough so that the offset
does not overflow the 16-bit load/store offset field. */
rtx sdmode_stack_slot;
/* Alternative internal arg pointer for -fsplit-stack. */ /* Alternative internal arg pointer for -fsplit-stack. */
rtx split_stack_arg_pointer; rtx split_stack_arg_pointer;
bool split_stack_argp_used; bool split_stack_argp_used;
...@@ -1872,12 +1868,6 @@ static const struct attribute_spec rs6000_attribute_table[] = ...@@ -1872,12 +1868,6 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_BUILTIN_RECIPROCAL #undef TARGET_BUILTIN_RECIPROCAL
#define TARGET_BUILTIN_RECIPROCAL rs6000_builtin_reciprocal #define TARGET_BUILTIN_RECIPROCAL rs6000_builtin_reciprocal
#undef TARGET_EXPAND_TO_RTL_HOOK
#define TARGET_EXPAND_TO_RTL_HOOK rs6000_alloc_sdmode_stack_slot
#undef TARGET_INSTANTIATE_DECLS
#define TARGET_INSTANTIATE_DECLS rs6000_instantiate_decls
#undef TARGET_SECONDARY_RELOAD #undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD rs6000_secondary_reload #define TARGET_SECONDARY_RELOAD rs6000_secondary_reload
...@@ -8628,14 +8618,6 @@ legitimate_indexed_address_p (rtx x, int strict) ...@@ -8628,14 +8618,6 @@ legitimate_indexed_address_p (rtx x, int strict)
op0 = XEXP (x, 0); op0 = XEXP (x, 0);
op1 = XEXP (x, 1); op1 = XEXP (x, 1);
/* Recognize the rtl generated by reload which we know will later be
replaced with proper base and index regs. */
if (!strict
&& reload_in_progress
&& (REG_P (op0) || GET_CODE (op0) == PLUS)
&& REG_P (op1))
return true;
return (REG_P (op0) && REG_P (op1) return (REG_P (op0) && REG_P (op1)
&& ((INT_REG_OK_FOR_BASE_P (op0, strict) && ((INT_REG_OK_FOR_BASE_P (op0, strict)
&& INT_REG_OK_FOR_INDEX_P (op1, strict)) && INT_REG_OK_FOR_INDEX_P (op1, strict))
...@@ -9879,9 +9861,7 @@ rs6000_debug_legitimate_address_p (machine_mode mode, rtx x, ...@@ -9879,9 +9861,7 @@ rs6000_debug_legitimate_address_p (machine_mode mode, rtx x,
ret ? "true" : "false", ret ? "true" : "false",
GET_MODE_NAME (mode), GET_MODE_NAME (mode),
reg_ok_strict, reg_ok_strict,
(reload_completed (reload_completed ? "after" : "before"),
? "after"
: (reload_in_progress ? "progress" : "before")),
GET_RTX_NAME (GET_CODE (x))); GET_RTX_NAME (GET_CODE (x)));
debug_rtx (x); debug_rtx (x);
...@@ -10283,9 +10263,6 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c) ...@@ -10283,9 +10263,6 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c)
static void static void
rs6000_eliminate_indexed_memrefs (rtx operands[2]) rs6000_eliminate_indexed_memrefs (rtx operands[2])
{ {
if (reload_in_progress)
return;
if (GET_CODE (operands[0]) == MEM if (GET_CODE (operands[0]) == MEM
&& GET_CODE (XEXP (operands[0], 0)) != REG && GET_CODE (XEXP (operands[0], 0)) != REG
&& ! legitimate_constant_pool_address_p (XEXP (operands[0], 0), && ! legitimate_constant_pool_address_p (XEXP (operands[0], 0),
...@@ -10397,10 +10374,10 @@ rs6000_emit_le_vsx_load (rtx dest, rtx source, machine_mode mode) ...@@ -10397,10 +10374,10 @@ rs6000_emit_le_vsx_load (rtx dest, rtx source, machine_mode mode)
void void
rs6000_emit_le_vsx_store (rtx dest, rtx source, machine_mode mode) rs6000_emit_le_vsx_store (rtx dest, rtx source, machine_mode mode)
{ {
/* This should never be called during or after reload, because it does /* This should never be called during or after LRA, because it does
not re-permute the source register. It is intended only for use not re-permute the source register. It is intended only for use
during expand. */ during expand. */
gcc_assert (!reload_in_progress && !lra_in_progress && !reload_completed); gcc_assert (!lra_in_progress && !reload_completed);
/* Use V2DImode to do swaps of types with 128-bit scalar parts (TImode, /* Use V2DImode to do swaps of types with 128-bit scalar parts (TImode,
V1TImode). */ V1TImode). */
...@@ -10492,8 +10469,7 @@ valid_sf_si_move (rtx dest, rtx src, machine_mode mode) ...@@ -10492,8 +10469,7 @@ valid_sf_si_move (rtx dest, rtx src, machine_mode mode)
static bool static bool
rs6000_emit_move_si_sf_subreg (rtx dest, rtx source, machine_mode mode) rs6000_emit_move_si_sf_subreg (rtx dest, rtx source, machine_mode mode)
{ {
if (TARGET_DIRECT_MOVE_64BIT && !reload_in_progress && !reload_completed if (TARGET_DIRECT_MOVE_64BIT && !lra_in_progress && !reload_completed
&& !lra_in_progress
&& (!SUBREG_P (dest) || !sf_subreg_operand (dest, mode)) && (!SUBREG_P (dest) || !sf_subreg_operand (dest, mode))
&& SUBREG_P (source) && sf_subreg_operand (source, mode)) && SUBREG_P (source) && sf_subreg_operand (source, mode))
{ {
...@@ -10527,10 +10503,10 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10527,10 +10503,10 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
if (TARGET_DEBUG_ADDR) if (TARGET_DEBUG_ADDR)
{ {
fprintf (stderr, fprintf (stderr,
"\nrs6000_emit_move: mode = %s, reload_in_progress = %d, " "\nrs6000_emit_move: mode = %s, lra_in_progress = %d, "
"reload_completed = %d, can_create_pseudos = %d.\ndest:\n", "reload_completed = %d, can_create_pseudos = %d.\ndest:\n",
GET_MODE_NAME (mode), GET_MODE_NAME (mode),
reload_in_progress, lra_in_progress,
reload_completed, reload_completed,
can_create_pseudo_p ()); can_create_pseudo_p ());
debug_rtx (dest); debug_rtx (dest);
...@@ -10604,12 +10580,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10604,12 +10580,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
operands[1] = tmp; operands[1] = tmp;
} }
/* Handle the case where reload calls us with an invalid address. */
if (reload_in_progress && mode == Pmode
&& (! general_operand (operands[1], mode)
|| ! nonimmediate_operand (operands[0], mode)))
goto emit_set;
/* 128-bit constant floating-point values on Darwin should really be loaded /* 128-bit constant floating-point values on Darwin should really be loaded
as two parts. However, this premature splitting is a problem when DFmode as two parts. However, this premature splitting is a problem when DFmode
values can go into Altivec registers. */ values can go into Altivec registers. */
...@@ -10627,11 +10597,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10627,11 +10597,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
return; return;
} }
if (reload_in_progress && cfun->machine->sdmode_stack_slot != NULL_RTX)
cfun->machine->sdmode_stack_slot =
eliminate_regs (cfun->machine->sdmode_stack_slot, VOIDmode, NULL_RTX);
/* Transform (p0:DD, (SUBREG:DD p1:SD)) to ((SUBREG:SD p0:DD), /* Transform (p0:DD, (SUBREG:DD p1:SD)) to ((SUBREG:SD p0:DD),
p1:SD) if p1 is not of floating point class and p0 is spilled as p1:SD) if p1 is not of floating point class and p0 is spilled as
we can have no analogous movsd_store for this. */ we can have no analogous movsd_store for this. */
...@@ -10741,57 +10706,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10741,57 +10706,6 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
return; return;
} }
if (reload_in_progress
&& mode == SDmode
&& cfun->machine->sdmode_stack_slot != NULL_RTX
&& MEM_P (operands[0])
&& rtx_equal_p (operands[0], cfun->machine->sdmode_stack_slot)
&& REG_P (operands[1]))
{
if (FP_REGNO_P (REGNO (operands[1])))
{
rtx mem = adjust_address_nv (operands[0], DDmode, 0);
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
emit_insn (gen_movsd_store (mem, operands[1]));
}
else if (INT_REGNO_P (REGNO (operands[1])))
{
rtx mem = operands[0];
if (BYTES_BIG_ENDIAN)
mem = adjust_address_nv (mem, mode, 4);
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
emit_insn (gen_movsd_hardfloat (mem, operands[1]));
}
else
gcc_unreachable();
return;
}
if (reload_in_progress
&& mode == SDmode
&& REG_P (operands[0])
&& MEM_P (operands[1])
&& cfun->machine->sdmode_stack_slot != NULL_RTX
&& rtx_equal_p (operands[1], cfun->machine->sdmode_stack_slot))
{
if (FP_REGNO_P (REGNO (operands[0])))
{
rtx mem = adjust_address_nv (operands[1], DDmode, 0);
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
emit_insn (gen_movsd_load (operands[0], mem));
}
else if (INT_REGNO_P (REGNO (operands[0])))
{
rtx mem = operands[1];
if (BYTES_BIG_ENDIAN)
mem = adjust_address_nv (mem, mode, 4);
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
emit_insn (gen_movsd_hardfloat (operands[0], mem));
}
else
gcc_unreachable();
return;
}
/* FIXME: In the long term, this switch statement should go away /* FIXME: In the long term, this switch statement should go away
and be replaced by a sequence of tests based on things like and be replaced by a sequence of tests based on things like
mode == Pmode. */ mode == Pmode. */
...@@ -10950,10 +10864,9 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10950,10 +10864,9 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
/* If we are to limit the number of things we put in the TOC and /* If we are to limit the number of things we put in the TOC and
this is a symbol plus a constant we can add in one insn, this is a symbol plus a constant we can add in one insn,
just put the symbol in the TOC and add the constant. Don't do just put the symbol in the TOC and add the constant. */
this if reload is in progress. */
if (GET_CODE (operands[1]) == CONST if (GET_CODE (operands[1]) == CONST
&& TARGET_NO_SUM_IN_TOC && ! reload_in_progress && TARGET_NO_SUM_IN_TOC
&& GET_CODE (XEXP (operands[1], 0)) == PLUS && GET_CODE (XEXP (operands[1], 0)) == PLUS
&& add_operand (XEXP (XEXP (operands[1], 0), 1), mode) && add_operand (XEXP (XEXP (operands[1], 0), 1), mode)
&& (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF
...@@ -10999,10 +10912,9 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) ...@@ -10999,10 +10912,9 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode)
/* Above, we may have called force_const_mem which may have returned /* Above, we may have called force_const_mem which may have returned
an invalid address. If we can, fix this up; otherwise, reload will an invalid address. If we can, fix this up; otherwise, reload will
have to deal with it. */ have to deal with it. */
if (GET_CODE (operands[1]) == MEM && ! reload_in_progress) if (GET_CODE (operands[1]) == MEM)
operands[1] = validize_mem (operands[1]); operands[1] = validize_mem (operands[1]);
emit_set:
emit_insn (gen_rtx_SET (operands[0], operands[1])); emit_insn (gen_rtx_SET (operands[0], operands[1]));
} }
...@@ -19195,42 +19107,6 @@ mems_ok_for_quad_peep (rtx mem1, rtx mem2) ...@@ -19195,42 +19107,6 @@ mems_ok_for_quad_peep (rtx mem1, rtx mem2)
return 1; return 1;
} }
rtx
rs6000_secondary_memory_needed_rtx (machine_mode mode)
{
static bool eliminated = false;
rtx ret;
if (mode != SDmode || TARGET_NO_SDMODE_STACK)
ret = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
else
{
rtx mem = cfun->machine->sdmode_stack_slot;
gcc_assert (mem != NULL_RTX);
if (!eliminated)
{
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
cfun->machine->sdmode_stack_slot = mem;
eliminated = true;
}
ret = mem;
}
if (TARGET_DEBUG_ADDR)
{
fprintf (stderr, "\nrs6000_secondary_memory_needed_rtx, mode %s, rtx:\n",
GET_MODE_NAME (mode));
if (!ret)
fprintf (stderr, "\tNULL_RTX\n");
else
debug_rtx (ret);
}
return ret;
}
/* Return the mode to be used for memory when a secondary memory /* Return the mode to be used for memory when a secondary memory
location is needed. For SDmode values we need to use DDmode, in location is needed. For SDmode values we need to use DDmode, in
all other cases we can use the same mode. */ all other cases we can use the same mode. */
...@@ -19242,36 +19118,6 @@ rs6000_secondary_memory_needed_mode (machine_mode mode) ...@@ -19242,36 +19118,6 @@ rs6000_secondary_memory_needed_mode (machine_mode mode)
return mode; return mode;
} }
static tree
rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
/* Don't walk into types. */
if (*tp == NULL_TREE || *tp == error_mark_node || TYPE_P (*tp))
{
*walk_subtrees = 0;
return NULL_TREE;
}
switch (TREE_CODE (*tp))
{
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
case RESULT_DECL:
case SSA_NAME:
case REAL_CST:
case MEM_REF:
case VIEW_CONVERT_EXPR:
if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode)
return *tp;
break;
default:
break;
}
return NULL_TREE;
}
/* Classify a register type. Because the FMRGOW/FMRGEW instructions only work /* Classify a register type. Because the FMRGOW/FMRGEW instructions only work
on traditional floating point registers, and the VMRGOW/VMRGEW instructions on traditional floating point registers, and the VMRGOW/VMRGEW instructions
only work on the traditional altivec registers, note if an altivec register only work on the traditional altivec registers, note if an altivec register
...@@ -19292,7 +19138,7 @@ register_to_reg_type (rtx reg, bool *is_altivec) ...@@ -19292,7 +19138,7 @@ register_to_reg_type (rtx reg, bool *is_altivec)
regno = REGNO (reg); regno = REGNO (reg);
if (regno >= FIRST_PSEUDO_REGISTER) if (regno >= FIRST_PSEUDO_REGISTER)
{ {
if (!lra_in_progress && !reload_in_progress && !reload_completed) if (!lra_in_progress && !reload_completed)
return PSEUDO_REG_TYPE; return PSEUDO_REG_TYPE;
regno = true_regnum (reg); regno = true_regnum (reg);
...@@ -20369,64 +20215,6 @@ rs6000_secondary_reload_gpr (rtx reg, rtx mem, rtx scratch, bool store_p) ...@@ -20369,64 +20215,6 @@ rs6000_secondary_reload_gpr (rtx reg, rtx mem, rtx scratch, bool store_p)
return; return;
} }
/* Allocate a 64-bit stack slot to be used for copying SDmode values through if
this function has any SDmode references. If we are on a power7 or later, we
don't need the 64-bit stack slot since the LFIWZX and STIFWX instructions
can load/store the value. */
static void
rs6000_alloc_sdmode_stack_slot (void)
{
tree t;
basic_block bb;
gimple_stmt_iterator gsi;
gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
/* We use a different approach for dealing with the secondary
memory in LRA. */
if (ira_use_lra_p)
return;
if (TARGET_NO_SDMODE_STACK)
return;
FOR_EACH_BB_FN (bb, cfun)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree ret = walk_gimple_op (gsi_stmt (gsi), rs6000_check_sdmode, NULL);
if (ret)
{
rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
SDmode, 0);
return;
}
}
/* Check for any SDmode parameters of the function. */
for (t = DECL_ARGUMENTS (cfun->decl); t; t = DECL_CHAIN (t))
{
if (TREE_TYPE (t) == error_mark_node)
continue;
if (TYPE_MODE (TREE_TYPE (t)) == SDmode
|| TYPE_MODE (DECL_ARG_TYPE (t)) == SDmode)
{
rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
SDmode, 0);
return;
}
}
}
static void
rs6000_instantiate_decls (void)
{
if (cfun->machine->sdmode_stack_slot != NULL_RTX)
instantiate_decl_rtl (cfun->machine->sdmode_stack_slot);
}
/* Given an rtx X being reloaded into a reg required to be /* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use. in class CLASS, return the class of reg to actually use.
In general this is just CLASS; but on some machines In general this is just CLASS; but on some machines
...@@ -23454,10 +23242,9 @@ static rtx ...@@ -23454,10 +23242,9 @@ static rtx
rs6000_pre_atomic_barrier (rtx mem, enum memmodel model) rs6000_pre_atomic_barrier (rtx mem, enum memmodel model)
{ {
rtx addr = XEXP (mem, 0); rtx addr = XEXP (mem, 0);
int strict_p = (reload_in_progress || reload_completed);
if (!legitimate_indirect_address_p (addr, strict_p) if (!legitimate_indirect_address_p (addr, reload_completed)
&& !legitimate_indexed_address_p (addr, strict_p)) && !legitimate_indexed_address_p (addr, reload_completed))
{ {
addr = force_reg (Pmode, addr); addr = force_reg (Pmode, addr);
mem = replace_equiv_address_nv (mem, addr); mem = replace_equiv_address_nv (mem, addr);
...@@ -33184,7 +32971,7 @@ rs6000_machopic_legitimize_pic_address (rtx orig, machine_mode mode, ...@@ -33184,7 +32971,7 @@ rs6000_machopic_legitimize_pic_address (rtx orig, machine_mode mode,
{ {
rtx base, offset; rtx base, offset;
if (reg == NULL && ! reload_in_progress && ! reload_completed) if (reg == NULL && !reload_completed)
reg = gen_reg_rtx (Pmode); reg = gen_reg_rtx (Pmode);
if (GET_CODE (orig) == CONST) if (GET_CODE (orig) == CONST)
...@@ -33210,7 +32997,7 @@ rs6000_machopic_legitimize_pic_address (rtx orig, machine_mode mode, ...@@ -33210,7 +32997,7 @@ rs6000_machopic_legitimize_pic_address (rtx orig, machine_mode mode,
{ {
if (SMALL_INT (offset)) if (SMALL_INT (offset))
return plus_constant (Pmode, base, INTVAL (offset)); return plus_constant (Pmode, base, INTVAL (offset));
else if (! reload_in_progress && ! reload_completed) else if (!reload_completed)
offset = force_reg (Pmode, offset); offset = force_reg (Pmode, offset);
else else
{ {
...@@ -37459,7 +37246,7 @@ rs6000_allocate_stack_temp (machine_mode mode, ...@@ -37459,7 +37246,7 @@ rs6000_allocate_stack_temp (machine_mode mode,
{ {
rtx stack = assign_stack_temp (mode, GET_MODE_SIZE (mode)); rtx stack = assign_stack_temp (mode, GET_MODE_SIZE (mode));
rtx addr = XEXP (stack, 0); rtx addr = XEXP (stack, 0);
int strict_p = (reload_in_progress || reload_completed); int strict_p = reload_completed;
if (!legitimate_indirect_address_p (addr, strict_p)) if (!legitimate_indirect_address_p (addr, strict_p))
{ {
...@@ -37481,13 +37268,12 @@ rs6000_allocate_stack_temp (machine_mode mode, ...@@ -37481,13 +37268,12 @@ rs6000_allocate_stack_temp (machine_mode mode,
rtx rtx
rs6000_address_for_fpconvert (rtx x) rs6000_address_for_fpconvert (rtx x)
{ {
int strict_p = (reload_in_progress || reload_completed);
rtx addr; rtx addr;
gcc_assert (MEM_P (x)); gcc_assert (MEM_P (x));
addr = XEXP (x, 0); addr = XEXP (x, 0);
if (! legitimate_indirect_address_p (addr, strict_p) if (! legitimate_indirect_address_p (addr, reload_completed)
&& ! legitimate_indexed_address_p (addr, strict_p)) && ! legitimate_indexed_address_p (addr, reload_completed))
{ {
if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC) if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{ {
...@@ -37525,10 +37311,9 @@ rs6000_address_for_altivec (rtx x) ...@@ -37525,10 +37311,9 @@ rs6000_address_for_altivec (rtx x)
if (!altivec_indexed_or_indirect_operand (x, GET_MODE (x))) if (!altivec_indexed_or_indirect_operand (x, GET_MODE (x)))
{ {
rtx addr = XEXP (x, 0); rtx addr = XEXP (x, 0);
int strict_p = (reload_in_progress || reload_completed);
if (!legitimate_indexed_address_p (addr, strict_p) if (!legitimate_indexed_address_p (addr, reload_completed)
&& !legitimate_indirect_address_p (addr, strict_p)) && !legitimate_indirect_address_p (addr, reload_completed))
addr = copy_to_mode_reg (Pmode, addr); addr = copy_to_mode_reg (Pmode, addr);
addr = gen_rtx_AND (Pmode, addr, GEN_INT (-16)); addr = gen_rtx_AND (Pmode, addr, GEN_INT (-16));
...@@ -1583,13 +1583,6 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX]; ...@@ -1583,13 +1583,6 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX];
#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
rs6000_secondary_memory_needed_ptr (CLASS1, CLASS2, MODE) rs6000_secondary_memory_needed_ptr (CLASS1, CLASS2, MODE)
/* For cpus that cannot load/store SDmode values from the 64-bit
FP registers without using a full 64-bit load/store, we need
to allocate a full 64-bit stack slot for them. */
#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \
rs6000_secondary_memory_needed_rtx (MODE)
/* Specify the mode to be used for memory when a secondary memory /* Specify the mode to be used for memory when a secondary memory
location is needed. For cpus that cannot load/store SDmode values location is needed. For cpus that cannot load/store SDmode values
from the 64-bit FP registers without using a full 64-bit from the 64-bit FP registers without using a full 64-bit
......
...@@ -6672,7 +6672,7 @@ ...@@ -6672,7 +6672,7 @@
UNSPEC_MOVSI_GOT))] UNSPEC_MOVSI_GOT))]
"DEFAULT_ABI == ABI_V4 "DEFAULT_ABI == ABI_V4
&& flag_pic == 1 && flag_pic == 1
&& (reload_in_progress || reload_completed)" && reload_completed"
[(set (match_dup 0) (match_dup 2)) [(set (match_dup 0) (match_dup 2))
(set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)] (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)]
UNSPEC_MOVSI_GOT))] UNSPEC_MOVSI_GOT))]
...@@ -8225,7 +8225,7 @@ ...@@ -8225,7 +8225,7 @@
(and:P (plus:P (match_operand:P 1 "gpc_reg_operand" "r") (and:P (plus:P (match_operand:P 1 "gpc_reg_operand" "r")
(match_operand:P 2 "reg_or_cint_operand" "rI")) (match_operand:P 2 "reg_or_cint_operand" "rI"))
(const_int -16)))] (const_int -16)))]
"TARGET_ALTIVEC && (reload_in_progress || reload_completed)" "TARGET_ALTIVEC && reload_completed"
"#" "#"
"&& reload_completed" "&& reload_completed"
[(set (match_dup 0) [(set (match_dup 0)
......
...@@ -1201,7 +1201,7 @@ ...@@ -1201,7 +1201,7 @@
UNSPEC_VSX_MULSD))] UNSPEC_VSX_MULSD))]
"VECTOR_MEM_VSX_P (V2DImode)" "VECTOR_MEM_VSX_P (V2DImode)"
"#" "#"
"VECTOR_MEM_VSX_P (V2DImode) && !reload_completed && !reload_in_progress" "VECTOR_MEM_VSX_P (V2DImode) && !reload_completed"
[(const_int 0)] [(const_int 0)]
" "
{ {
...@@ -1239,7 +1239,7 @@ ...@@ -1239,7 +1239,7 @@
UNSPEC_VSX_DIVSD))] UNSPEC_VSX_DIVSD))]
"VECTOR_MEM_VSX_P (V2DImode)" "VECTOR_MEM_VSX_P (V2DImode)"
"#" "#"
"VECTOR_MEM_VSX_P (V2DImode) && !reload_completed && !reload_in_progress" "VECTOR_MEM_VSX_P (V2DImode) && !reload_completed"
[(const_int 0)] [(const_int 0)]
" "
{ {
...@@ -1267,7 +1267,7 @@ ...@@ -1267,7 +1267,7 @@
UNSPEC_VSX_DIVUD))] UNSPEC_VSX_DIVUD))]
"VECTOR_MEM_VSX_P (V2DImode)" "VECTOR_MEM_VSX_P (V2DImode)"
"#" "#"
"VECTOR_MEM_VSX_P (V2DImode) && !reload_completed && !reload_in_progress" "VECTOR_MEM_VSX_P (V2DImode) && !reload_completed"
[(const_int 0)] [(const_int 0)]
" "
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment