summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-12 09:05:29 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-12 09:05:29 +0000
commite506ea6276574d41af68a704c0c6a27e9cd08448 (patch)
treed18714a2611c86230e08bcb51878ff13292e00cb
parentef53eb98d0131d3b22cab8d53be3c675d80606c7 (diff)
downloadgcc-e506ea6276574d41af68a704c0c6a27e9cd08448.tar.gz
gcc/
* rtl.h (rtx_function, for_each_rtx, for_each_rtx_in_insn): Delete. * rtlanal.c (non_rtx_starting_operands, for_each_rtx_1, for_each_rtx): (for_each_rtx_in_insn): Delete. (init_rtlanal): Remove initialization of non_rtx_starting_operands. * df-core.c: Remove reference to for_each_rtx in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217407 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/df-core.c2
-rw-r--r--gcc/rtl.h4
-rw-r--r--gcc/rtlanal.c141
4 files changed, 10 insertions, 145 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77bd3ee4c96..fc8510dc972 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-12 Richard Sandiford <richard.sandiford@arm.com>
+
+ * rtl.h (rtx_function, for_each_rtx, for_each_rtx_in_insn): Delete.
+ * rtlanal.c (non_rtx_starting_operands, for_each_rtx_1, for_each_rtx):
+ (for_each_rtx_in_insn): Delete.
+ (init_rtlanal): Remove initialization of non_rtx_starting_operands.
+ * df-core.c: Remove reference to for_each_rtx in comment.
+
2014-11-12 Tejas Belagod <tejas.belagod@arm.com>
* Makefile.in (TEXI_GCC_FILES): Remove arm-acle-intrinsics.texi,
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 691ed715a80..8e7a92fbcb4 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -181,7 +181,7 @@ There are four ways of doing the incremental scanning:
next call to df_analyze or df_process_deferred_rescans.
This mode is also used by a few passes that still rely on note_uses,
- note_stores and for_each_rtx instead of using the DF data. This
+ note_stores and rtx iterators instead of using the DF data. This
can be said to fall under case 1c.
To enable this mode, call df_set_flags (DF_DEFER_INSN_RESCAN).
diff --git a/gcc/rtl.h b/gcc/rtl.h
index fa38abb102e..3bfb6bf1c5f 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2885,10 +2885,6 @@ extern bool tablejump_p (const rtx_insn *, rtx *, rtx_jump_table_data **);
extern int computed_jump_p (const_rtx);
extern bool tls_referenced_p (const_rtx);
-typedef int (*rtx_function) (rtx *, void *);
-extern int for_each_rtx (rtx *, rtx_function, void *);
-extern int for_each_rtx_in_insn (rtx_insn **, rtx_function, void *);
-
/* Callback for for_each_inc_dec, to process the autoinc operation OP
within MEM that sets DEST to SRC + SRCOFF, or SRC if SRCOFF is
NULL. The callback is passed the same opaque ARG passed to
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c9bf69c4717..49c2d4ee9cd 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -65,10 +65,6 @@ static unsigned int cached_num_sign_bit_copies (const_rtx, machine_mode, const_r
static unsigned int num_sign_bit_copies1 (const_rtx, machine_mode, const_rtx,
machine_mode, unsigned int);
-/* Offset of the first 'e', 'E' or 'V' operand for each rtx code, or
- -1 if a code has no such operand. */
-static int non_rtx_starting_operands[NUM_RTX_CODE];
-
rtx_subrtx_bound_info rtx_all_subrtx_bounds[NUM_RTX_CODE];
rtx_subrtx_bound_info rtx_nonconst_subrtx_bounds[NUM_RTX_CODE];
@@ -3020,137 +3016,6 @@ computed_jump_p (const_rtx insn)
return 0;
}
-/* Optimized loop of for_each_rtx, trying to avoid useless recursive
- calls. Processes the subexpressions of EXP and passes them to F. */
-static int
-for_each_rtx_1 (rtx exp, int n, rtx_function f, void *data)
-{
- int result, i, j;
- const char *format = GET_RTX_FORMAT (GET_CODE (exp));
- rtx *x;
-
- for (; format[n] != '\0'; n++)
- {
- switch (format[n])
- {
- case 'e':
- /* Call F on X. */
- x = &XEXP (exp, n);
- result = (*f) (x, data);
- if (result == -1)
- /* Do not traverse sub-expressions. */
- continue;
- else if (result != 0)
- /* Stop the traversal. */
- return result;
-
- if (*x == NULL_RTX)
- /* There are no sub-expressions. */
- continue;
-
- i = non_rtx_starting_operands[GET_CODE (*x)];
- if (i >= 0)
- {
- result = for_each_rtx_1 (*x, i, f, data);
- if (result != 0)
- return result;
- }
- break;
-
- case 'V':
- case 'E':
- if (XVEC (exp, n) == 0)
- continue;
- for (j = 0; j < XVECLEN (exp, n); ++j)
- {
- /* Call F on X. */
- x = &XVECEXP (exp, n, j);
- result = (*f) (x, data);
- if (result == -1)
- /* Do not traverse sub-expressions. */
- continue;
- else if (result != 0)
- /* Stop the traversal. */
- return result;
-
- if (*x == NULL_RTX)
- /* There are no sub-expressions. */
- continue;
-
- i = non_rtx_starting_operands[GET_CODE (*x)];
- if (i >= 0)
- {
- result = for_each_rtx_1 (*x, i, f, data);
- if (result != 0)
- return result;
- }
- }
- break;
-
- default:
- /* Nothing to do. */
- break;
- }
- }
-
- return 0;
-}
-
-/* Traverse X via depth-first search, calling F for each
- sub-expression (including X itself). F is also passed the DATA.
- If F returns -1, do not traverse sub-expressions, but continue
- traversing the rest of the tree. If F ever returns any other
- nonzero value, stop the traversal, and return the value returned
- by F. Otherwise, return 0. This function does not traverse inside
- tree structure that contains RTX_EXPRs, or into sub-expressions
- whose format code is `0' since it is not known whether or not those
- codes are actually RTL.
-
- This routine is very general, and could (should?) be used to
- implement many of the other routines in this file. */
-
-int
-for_each_rtx (rtx *x, rtx_function f, void *data)
-{
- int result;
- int i;
-
- /* Call F on X. */
- result = (*f) (x, data);
- if (result == -1)
- /* Do not traverse sub-expressions. */
- return 0;
- else if (result != 0)
- /* Stop the traversal. */
- return result;
-
- if (*x == NULL_RTX)
- /* There are no sub-expressions. */
- return 0;
-
- i = non_rtx_starting_operands[GET_CODE (*x)];
- if (i < 0)
- return 0;
-
- return for_each_rtx_1 (*x, i, f, data);
-}
-
-/* Like "for_each_rtx", but for calling on an rtx_insn **. */
-
-int
-for_each_rtx_in_insn (rtx_insn **insn, rtx_function f, void *data)
-{
- rtx insn_as_rtx = *insn;
- int result;
-
- result = for_each_rtx (&insn_as_rtx, f, data);
-
- if (insn_as_rtx != *insn)
- *insn = safe_as_a <rtx_insn *> (insn_as_rtx);
-
- return result;
-}
-
/* MEM has a PRE/POST-INC/DEC/MODIFY address X. Extract the operands of
@@ -5496,17 +5361,13 @@ setup_reg_subrtx_bounds (unsigned int code)
return true;
}
-/* Initialize non_rtx_starting_operands, which is used to speed up
- for_each_rtx, and rtx_all_subrtx_bounds. */
+/* Initialize rtx_all_subrtx_bounds. */
void
init_rtlanal (void)
{
int i;
for (i = 0; i < NUM_RTX_CODE; i++)
{
- const char *format = GET_RTX_FORMAT (i);
- const char *first = strpbrk (format, "eEV");
- non_rtx_starting_operands[i] = first ? first - format : -1;
if (!setup_reg_subrtx_bounds (i))
rtx_all_subrtx_bounds[i].count = UCHAR_MAX;
if (GET_RTX_CLASS (i) != RTX_CONST_OBJ)