diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-10 06:23:17 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-10 06:23:17 -0500 |
commit | 4312729434c6f7f1ce26ba84833876c87e1045df (patch) | |
tree | fdeabbd8e923fd146bd2483387eff54d134696d6 /gcc/emit-rtl.c | |
parent | 935ddcf539e0aecc2b6da58f5b70d87d1ef43de8 (diff) | |
download | gcc-4312729434c6f7f1ce26ba84833876c87e1045df.zip gcc-4312729434c6f7f1ce26ba84833876c87e1045df.tar.gz gcc-4312729434c6f7f1ce26ba84833876c87e1045df.tar.bz2 |
(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
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index f04ba5f..66c2436 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -249,6 +249,9 @@ struct sequence_stack *sequence_stack; static struct sequence_stack *sequence_element_free_list; 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; /* Filename and line number of last line-number note, @@ -1494,6 +1497,8 @@ restore_emit_status (p) sequence_element_free_list = 0; for (i = 0; i < SEQUENCE_RESULT_SIZE; i++) sequence_result[i] = 0; + + free_insn = 0; } /* Go through all the RTL insn bodies and copy any invalid shared structure. @@ -2141,9 +2146,17 @@ make_insn_raw (pattern) { register rtx insn; - insn = rtx_alloc (INSN); - INSN_UID (insn) = cur_insn_uid++; + /* If in RTL generation phase, see if FREE_INSN can be used. */ + 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; INSN_CODE (insn) = -1; LOG_LINKS (insn) = NULL; @@ -3115,7 +3128,11 @@ gen_sequence () /* Don't discard the call usage field. */ || (GET_CODE (first_insn) == CALL_INSN && 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 appropriate length around. */ @@ -3160,6 +3177,7 @@ init_emit () sequence_element_free_list = 0; for (i = 0; i < SEQUENCE_RESULT_SIZE; i++) sequence_result[i] = 0; + free_insn = 0; /* Init the tables that describe all the pseudo regs. */ |