Commit 43127294 by Richard Kenner

(free_insn): New variable.

(init_emit, restore_emit_status): Clear it.
(gen_sequence): Store insn in free_insn when sequence length is 1.
(make_insn_raw): Use free_insn if available and still in the rtl generation
phase.

From-SVN: r11508
parent 935ddcf5
...@@ -249,6 +249,9 @@ struct sequence_stack *sequence_stack; ...@@ -249,6 +249,9 @@ struct sequence_stack *sequence_stack;
static struct sequence_stack *sequence_element_free_list; static struct sequence_stack *sequence_element_free_list;
static rtx sequence_result[SEQUENCE_RESULT_SIZE]; static rtx sequence_result[SEQUENCE_RESULT_SIZE];
/* During RTL generation, we also keep a list of free INSN rtl codes. */
static rtx free_insn;
extern int rtx_equal_function_value_matters; extern int rtx_equal_function_value_matters;
/* Filename and line number of last line-number note, /* Filename and line number of last line-number note,
...@@ -1494,6 +1497,8 @@ restore_emit_status (p) ...@@ -1494,6 +1497,8 @@ restore_emit_status (p)
sequence_element_free_list = 0; sequence_element_free_list = 0;
for (i = 0; i < SEQUENCE_RESULT_SIZE; i++) for (i = 0; i < SEQUENCE_RESULT_SIZE; i++)
sequence_result[i] = 0; sequence_result[i] = 0;
free_insn = 0;
} }
/* Go through all the RTL insn bodies and copy any invalid shared structure. /* Go through all the RTL insn bodies and copy any invalid shared structure.
...@@ -2141,9 +2146,17 @@ make_insn_raw (pattern) ...@@ -2141,9 +2146,17 @@ make_insn_raw (pattern)
{ {
register rtx insn; register rtx insn;
insn = rtx_alloc (INSN); /* If in RTL generation phase, see if FREE_INSN can be used. */
INSN_UID (insn) = cur_insn_uid++; if (free_insn != 0 && rtx_equal_function_value_matters)
{
insn = free_insn;
free_insn = NEXT_INSN (free_insn);
PUT_CODE (insn, INSN);
}
else
insn = rtx_alloc (INSN);
INSN_UID (insn) = cur_insn_uid++;
PATTERN (insn) = pattern; PATTERN (insn) = pattern;
INSN_CODE (insn) = -1; INSN_CODE (insn) = -1;
LOG_LINKS (insn) = NULL; LOG_LINKS (insn) = NULL;
...@@ -3115,7 +3128,11 @@ gen_sequence () ...@@ -3115,7 +3128,11 @@ gen_sequence ()
/* Don't discard the call usage field. */ /* Don't discard the call usage field. */
|| (GET_CODE (first_insn) == CALL_INSN || (GET_CODE (first_insn) == CALL_INSN
&& CALL_INSN_FUNCTION_USAGE (first_insn) == NULL_RTX))) && CALL_INSN_FUNCTION_USAGE (first_insn) == NULL_RTX)))
return PATTERN (first_insn); {
NEXT_INSN (first_insn) = free_insn;
free_insn = first_insn;
return PATTERN (first_insn);
}
/* Put them in a vector. See if we already have a SEQUENCE of the /* Put them in a vector. See if we already have a SEQUENCE of the
appropriate length around. */ appropriate length around. */
...@@ -3160,6 +3177,7 @@ init_emit () ...@@ -3160,6 +3177,7 @@ init_emit ()
sequence_element_free_list = 0; sequence_element_free_list = 0;
for (i = 0; i < SEQUENCE_RESULT_SIZE; i++) for (i = 0; i < SEQUENCE_RESULT_SIZE; i++)
sequence_result[i] = 0; sequence_result[i] = 0;
free_insn = 0;
/* Init the tables that describe all the pseudo regs. */ /* Init the tables that describe all the pseudo regs. */
......
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