diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2020-11-02 16:52:17 -0500 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2020-11-02 17:00:40 -0500 |
commit | 3ceaafc95c77cded164cde58da41bed0cbe76489 (patch) | |
tree | 326ded9e5e98cbc3a190acdfff483417ff152581 /gcc | |
parent | 6058b874ef98af1104a5cb4618e1f3bfa7e3761c (diff) | |
download | gcc-3ceaafc95c77cded164cde58da41bed0cbe76489.zip gcc-3ceaafc95c77cded164cde58da41bed0cbe76489.tar.gz gcc-3ceaafc95c77cded164cde58da41bed0cbe76489.tar.bz2 |
Expand reg_equiv when scratches are removed.
gcc/ChangeLog:
* ira.c (ira_remove_scratches): Rename to remove_scratches. Make
it static and returning flag of any change.
(ira.c): Call ira_expand_reg_equiv in case of removing scratches.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ira.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -5214,7 +5214,8 @@ contains_X_constraint_p (const char *str) return false; } -/* Change INSN's scratches into pseudos and save their location. */ +/* Change INSN's scratches into pseudos and save their location. + Return true if we changed any scratch. */ bool ira_remove_insn_scratches (rtx_insn *insn, bool all_p, FILE *dump_file, rtx (*get_reg) (rtx original)) @@ -5245,17 +5246,19 @@ ira_remove_insn_scratches (rtx_insn *insn, bool all_p, FILE *dump_file, } /* Return new register of the same mode as ORIGINAL. Used in - ira_remove_scratches. */ + remove_scratches. */ static rtx get_scratch_reg (rtx original) { return gen_reg_rtx (GET_MODE (original)); } -/* Change scratches into pseudos and save their location. */ -void -ira_remove_scratches (void) +/* Change scratches into pseudos and save their location. Return true + if we changed any scratch. */ +static bool +remove_scratches (void) { + bool change_p = false; basic_block bb; rtx_insn *insn; @@ -5266,8 +5269,12 @@ ira_remove_scratches (void) FOR_BB_INSNS (bb, insn) if (INSN_P (insn) && ira_remove_insn_scratches (insn, false, ira_dump_file, get_scratch_reg)) - /* Because we might use DF, we need to keep DF info up to date. */ - df_insn_rescan (insn); + { + /* Because we might use DF, we need to keep DF info up to date. */ + df_insn_rescan (insn); + change_p = true; + } + return change_p; } /* Changes pseudos created by function remove_scratches onto scratches. */ @@ -5514,8 +5521,8 @@ ira (FILE *f) end_alias_analysis (); free (reg_equiv); - if (ira_use_lra_p) - ira_remove_scratches (); + if (ira_use_lra_p && remove_scratches ()) + ira_expand_reg_equiv (); if (resize_reg_info () && flag_ira_loop_pressure) ira_set_pseudo_classes (true, ira_dump_file); |