Commit f0d20631 by Ilya Leoshkevich Committed by Andreas Krebbel

S/390: Remove UNSPEC_LTREL_BASE

It was needed only for g5/g6 machines, which are now gone.

gcc/ChangeLog:

2018-09-06  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/s390/s390.c (s390_decompose_constant_pool_ref):
	Remove UNSPEC_LTREL_BASE check.
	(annotate_constant_pool_refs): Likewise.
	(find_constant_pool_ref): Likewise.
	(find_ltrel_base): Removed.
	(replace_ltrel_base): Removed.
	(s390_mainpool_finish): Remove replace_ltrel_base call.
	(s390_chunkify_start): Remove pending LTREL_BASE logic.
	(s390_chunkify_finish): Remove replace_ltrel_base call.
	* config/s390/s390.md: Remove UNSPEC_LTREL_BASE.

From-SVN: r264141
parent 308d9cda
2018-09-06 Ilya Leoshkevich <iii@linux.ibm.com>
* config/s390/s390.c (s390_decompose_constant_pool_ref):
Remove UNSPEC_LTREL_BASE check.
(annotate_constant_pool_refs): Likewise.
(find_constant_pool_ref): Likewise.
(find_ltrel_base): Removed.
(replace_ltrel_base): Removed.
(s390_mainpool_finish): Remove replace_ltrel_base call.
(s390_chunkify_start): Remove pending LTREL_BASE logic.
(s390_chunkify_finish): Remove replace_ltrel_base call.
* config/s390/s390.md: Remove UNSPEC_LTREL_BASE.
2018-09-06 Hans-Peter Nilsson <hp@axis.com> 2018-09-06 Hans-Peter Nilsson <hp@axis.com>
PR target/86779 PR target/86779
......
...@@ -2748,9 +2748,8 @@ s390_short_displacement (rtx disp) ...@@ -2748,9 +2748,8 @@ s390_short_displacement (rtx disp)
return false; return false;
} }
/* Attempts to split `ref', which should be either UNSPEC_LTREF or /* Attempts to split `ref', which should be UNSPEC_LTREF, into (base + `disp').
UNSPEC_LTREL_BASE, into (base + `disp'). In case pool base is not known, If successful, also determines the
caller-provided `pool_base' is used. If successful, also determines the
following characteristics of `ref': `is_ptr' - whether it can be an following characteristics of `ref': `is_ptr' - whether it can be an
LA argument, `is_base_ptr' - whether the resulting base is a well-known LA argument, `is_base_ptr' - whether the resulting base is a well-known
base register (stack/frame pointer, etc), `is_pool_ptr` - whether it is base register (stack/frame pointer, etc), `is_pool_ptr` - whether it is
...@@ -2758,8 +2757,7 @@ s390_short_displacement (rtx disp) ...@@ -2758,8 +2757,7 @@ s390_short_displacement (rtx disp)
literal pool pointers per insn during or after reload (`B' constraint). */ literal pool pointers per insn during or after reload (`B' constraint). */
static bool static bool
s390_decompose_constant_pool_ref (rtx *ref, rtx *disp, bool *is_ptr, s390_decompose_constant_pool_ref (rtx *ref, rtx *disp, bool *is_ptr,
bool *is_base_ptr, bool *is_pool_ptr, bool *is_base_ptr, bool *is_pool_ptr)
rtx pool_base)
{ {
if (!*ref) if (!*ref)
return true; return true;
...@@ -2778,13 +2776,6 @@ s390_decompose_constant_pool_ref (rtx *ref, rtx *disp, bool *is_ptr, ...@@ -2778,13 +2776,6 @@ s390_decompose_constant_pool_ref (rtx *ref, rtx *disp, bool *is_ptr,
*ref = XVECEXP (*ref, 0, 1); *ref = XVECEXP (*ref, 0, 1);
break; break;
case UNSPEC_LTREL_BASE:
if (XVECLEN (*ref, 0) == 1)
*ref = pool_base, *is_pool_ptr = true;
else
*ref = XVECEXP (*ref, 0, 1);
break;
default: default:
return false; return false;
} }
...@@ -2921,12 +2912,12 @@ s390_decompose_address (rtx addr, struct s390_address *out) ...@@ -2921,12 +2912,12 @@ s390_decompose_address (rtx addr, struct s390_address *out)
/* Validate base register. */ /* Validate base register. */
if (!s390_decompose_constant_pool_ref (&base, &disp, &pointer, &base_ptr, if (!s390_decompose_constant_pool_ref (&base, &disp, &pointer, &base_ptr,
&literal_pool, fake_pool_base)) &literal_pool))
return false; return false;
/* Validate index register. */ /* Validate index register. */
if (!s390_decompose_constant_pool_ref (&indx, &disp, &pointer, &indx_ptr, if (!s390_decompose_constant_pool_ref (&indx, &disp, &pointer, &indx_ptr,
&literal_pool, fake_pool_base)) &literal_pool))
return false; return false;
/* Prefer to use pointer as base, not index. */ /* Prefer to use pointer as base, not index. */
...@@ -8156,16 +8147,6 @@ annotate_constant_pool_refs (rtx *x) ...@@ -8156,16 +8147,6 @@ annotate_constant_pool_refs (rtx *x)
} }
} }
/* Annotate LTREL_BASE as well. */
if (GET_CODE (*x) == UNSPEC
&& XINT (*x, 1) == UNSPEC_LTREL_BASE)
{
rtx base = cfun->machine->base_reg;
*x = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XVECEXP (*x, 0, 0), base),
UNSPEC_LTREL_BASE);
return;
}
fmt = GET_RTX_FORMAT (GET_CODE (*x)); fmt = GET_RTX_FORMAT (GET_CODE (*x));
for (i = GET_RTX_LENGTH (GET_CODE (*x)) - 1; i >= 0; i--) for (i = GET_RTX_LENGTH (GET_CODE (*x)) - 1; i >= 0; i--)
{ {
...@@ -8195,10 +8176,6 @@ find_constant_pool_ref (rtx x, rtx *ref) ...@@ -8195,10 +8176,6 @@ find_constant_pool_ref (rtx x, rtx *ref)
int i, j; int i, j;
const char *fmt; const char *fmt;
/* Ignore LTREL_BASE references. */
if (GET_CODE (x) == UNSPEC
&& XINT (x, 1) == UNSPEC_LTREL_BASE)
return;
/* Likewise POOL_ENTRY insns. */ /* Likewise POOL_ENTRY insns. */
if (GET_CODE (x) == UNSPEC_VOLATILE if (GET_CODE (x) == UNSPEC_VOLATILE
&& XINT (x, 1) == UNSPECV_POOL_ENTRY) && XINT (x, 1) == UNSPECV_POOL_ENTRY)
...@@ -8281,73 +8258,6 @@ replace_constant_pool_ref (rtx *x, rtx ref, rtx offset) ...@@ -8281,73 +8258,6 @@ replace_constant_pool_ref (rtx *x, rtx ref, rtx offset)
} }
} }
/* Check whether X contains an UNSPEC_LTREL_BASE.
Return its constant pool symbol if found, NULL_RTX otherwise. */
static rtx
find_ltrel_base (rtx x)
{
int i, j;
const char *fmt;
if (GET_CODE (x) == UNSPEC
&& XINT (x, 1) == UNSPEC_LTREL_BASE)
return XVECEXP (x, 0, 0);
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
{
rtx fnd = find_ltrel_base (XEXP (x, i));
if (fnd)
return fnd;
}
else if (fmt[i] == 'E')
{
for (j = 0; j < XVECLEN (x, i); j++)
{
rtx fnd = find_ltrel_base (XVECEXP (x, i, j));
if (fnd)
return fnd;
}
}
}
return NULL_RTX;
}
/* Replace any occurrence of UNSPEC_LTREL_BASE in X with its base. */
static void
replace_ltrel_base (rtx *x)
{
int i, j;
const char *fmt;
if (GET_CODE (*x) == UNSPEC
&& XINT (*x, 1) == UNSPEC_LTREL_BASE)
{
*x = XVECEXP (*x, 0, 1);
return;
}
fmt = GET_RTX_FORMAT (GET_CODE (*x));
for (i = GET_RTX_LENGTH (GET_CODE (*x)) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
{
replace_ltrel_base (&XEXP (*x, i));
}
else if (fmt[i] == 'E')
{
for (j = 0; j < XVECLEN (*x, i); j++)
replace_ltrel_base (&XVECEXP (*x, i, j));
}
}
}
/* We keep a list of constants which we have to add to internal /* We keep a list of constants which we have to add to internal
constant tables in the middle of large functions. */ constant tables in the middle of large functions. */
...@@ -8832,9 +8742,6 @@ s390_mainpool_finish (struct constant_pool *pool) ...@@ -8832,9 +8742,6 @@ s390_mainpool_finish (struct constant_pool *pool)
for (rtx_insn *insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (rtx_insn *insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
if (INSN_P (insn))
replace_ltrel_base (&PATTERN (insn));
if (NONJUMP_INSN_P (insn) || CALL_P (insn)) if (NONJUMP_INSN_P (insn) || CALL_P (insn))
{ {
rtx addr, pool_ref = NULL_RTX; rtx addr, pool_ref = NULL_RTX;
...@@ -8868,7 +8775,6 @@ s390_chunkify_start (void) ...@@ -8868,7 +8775,6 @@ s390_chunkify_start (void)
{ {
struct constant_pool *curr_pool = NULL, *pool_list = NULL; struct constant_pool *curr_pool = NULL, *pool_list = NULL;
bitmap far_labels; bitmap far_labels;
rtx pending_ltrel = NULL_RTX;
rtx_insn *insn; rtx_insn *insn;
/* We need correct insn addresses. */ /* We need correct insn addresses. */
...@@ -8879,17 +8785,6 @@ s390_chunkify_start (void) ...@@ -8879,17 +8785,6 @@ s390_chunkify_start (void)
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
/* Check for pending LTREL_BASE. */
if (INSN_P (insn))
{
rtx ltrel_base = find_ltrel_base (PATTERN (insn));
if (ltrel_base)
{
gcc_assert (ltrel_base == pending_ltrel);
pending_ltrel = NULL_RTX;
}
}
if (NONJUMP_INSN_P (insn) || CALL_P (insn)) if (NONJUMP_INSN_P (insn) || CALL_P (insn))
{ {
rtx pool_ref = NULL_RTX; rtx pool_ref = NULL_RTX;
...@@ -8904,16 +8799,6 @@ s390_chunkify_start (void) ...@@ -8904,16 +8799,6 @@ s390_chunkify_start (void)
s390_add_constant (curr_pool, constant, mode); s390_add_constant (curr_pool, constant, mode);
s390_add_pool_insn (curr_pool, insn); s390_add_pool_insn (curr_pool, insn);
/* Don't split the pool chunk between a LTREL_OFFSET load
and the corresponding LTREL_BASE. */
if (GET_CODE (constant) == CONST
&& GET_CODE (XEXP (constant, 0)) == UNSPEC
&& XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET)
{
gcc_assert (!pending_ltrel);
pending_ltrel = pool_ref;
}
} }
} }
...@@ -8921,8 +8806,6 @@ s390_chunkify_start (void) ...@@ -8921,8 +8806,6 @@ s390_chunkify_start (void)
{ {
if (curr_pool) if (curr_pool)
s390_add_pool_insn (curr_pool, insn); s390_add_pool_insn (curr_pool, insn);
/* An LTREL_BASE must follow within the same basic block. */
gcc_assert (!pending_ltrel);
} }
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION) if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION)
...@@ -8942,7 +8825,6 @@ s390_chunkify_start (void) ...@@ -8942,7 +8825,6 @@ s390_chunkify_start (void)
if (curr_pool) if (curr_pool)
s390_end_pool (curr_pool, NULL); s390_end_pool (curr_pool, NULL);
gcc_assert (!pending_ltrel);
/* Find all labels that are branched into /* Find all labels that are branched into
from an insn belonging to a different chunk. */ from an insn belonging to a different chunk. */
...@@ -9056,9 +8938,6 @@ s390_chunkify_finish (struct constant_pool *pool_list) ...@@ -9056,9 +8938,6 @@ s390_chunkify_finish (struct constant_pool *pool_list)
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
if (INSN_P (insn))
replace_ltrel_base (&PATTERN (insn));
curr_pool = s390_find_pool (pool_list, insn); curr_pool = s390_find_pool (pool_list, insn);
if (!curr_pool) if (!curr_pool)
continue; continue;
......
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
; GOT/PLT and lt-relative accesses ; GOT/PLT and lt-relative accesses
UNSPEC_LTREL_OFFSET UNSPEC_LTREL_OFFSET
UNSPEC_LTREL_BASE
UNSPEC_POOL_OFFSET UNSPEC_POOL_OFFSET
UNSPEC_GOTENT UNSPEC_GOTENT
UNSPEC_GOT UNSPEC_GOT
......
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