diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-05 20:56:13 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-05 20:56:13 +0000 |
commit | 1f3a048aa0221dc35cc6a5abe55aa692e372a12a (patch) | |
tree | 8a8e7f4e3df96defc69d2feee8fbac6ac8d3a56b /gcc/lra-assigns.c | |
parent | 3af610956c973346fde07a92178be25170725e9f (diff) | |
download | gcc-1f3a048aa0221dc35cc6a5abe55aa692e372a12a.tar.gz |
2013-07-05 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55342
* lra-int.h (lra_subreg_reload_pseudos): New.
* lra.c: Add undoing optional reloads to the block diagram.
(lra_subreg_reload_pseudos): New.
(lra_optional_reload_pseudos): Change comments.
(lra): Init and clear lra_subreg_reload_pseudos. Clear
lra_optional_reload_pseudos after undo transformations.
* lra-assigns.c (pseudo_prefix_title): New.
(lra_setup_reg_renumber): Use it.
(spill_for): Ditto. Check subreg reload pseudos too.
(assign_by_spills): Consider subreg reload pseudos too.
* lra-constraints.c (simplify_operand_subreg): Use
lra_subreg_reload_pseudos instead of lra_optional_reload_pseudos.
(curr_insn_transform): Recognize and do optional reloads.
(undo_optional_reloads): New.
(lra_undo_inheritance): Call undo_optional_reloads.
2013-07-05 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55342
* gcc.target/i386/pr55342.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200723 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-assigns.c')
-rw-r--r-- | gcc/lra-assigns.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 9719f0dc9e7..b5736268e69 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -672,6 +672,19 @@ update_hard_regno_preference (int regno, int hard_regno, int div) } } +/* Return prefix title for pseudo REGNO. */ +static const char * +pseudo_prefix_title (int regno) +{ + return + (regno < lra_constraint_new_regno_start ? "" + : bitmap_bit_p (&lra_inheritance_pseudos, regno) ? "inheritance " + : bitmap_bit_p (&lra_split_regs, regno) ? "split " + : bitmap_bit_p (&lra_optional_reload_pseudos, regno) ? "optional reload " + : bitmap_bit_p (&lra_subreg_reload_pseudos, regno) ? "subreg reload " + : "reload "); +} + /* Update REG_RENUMBER and other pseudo preferences by assignment of HARD_REGNO to pseudo REGNO and print about it if PRINT_P. */ void @@ -692,13 +705,7 @@ lra_setup_reg_renumber (int regno, int hard_regno, bool print_p) lra_hard_reg_usage[hr + i] += lra_reg_info[regno].freq; if (print_p && lra_dump_file != NULL) fprintf (lra_dump_file, " Assign %d to %sr%d (freq=%d)\n", - reg_renumber[regno], - regno < lra_constraint_new_regno_start - ? "" - : bitmap_bit_p (&lra_inheritance_pseudos, regno) ? "inheritance " - : bitmap_bit_p (&lra_split_regs, regno) ? "split " - : bitmap_bit_p (&lra_optional_reload_pseudos, regno) - ? "optional reload ": "reload ", + reg_renumber[regno], pseudo_prefix_title (regno), regno, lra_reg_info[regno].freq); if (hard_regno >= 0) { @@ -844,6 +851,7 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap) if ((int) spill_regno >= lra_constraint_new_regno_start && ! bitmap_bit_p (&lra_inheritance_pseudos, spill_regno) && ! bitmap_bit_p (&lra_split_regs, spill_regno) + && ! bitmap_bit_p (&lra_subreg_reload_pseudos, spill_regno) && ! bitmap_bit_p (&lra_optional_reload_pseudos, spill_regno)) goto fail; insn_pseudos_num = 0; @@ -953,14 +961,7 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap) { if (lra_dump_file != NULL) fprintf (lra_dump_file, " Spill %sr%d(hr=%d, freq=%d) for r%d\n", - ((int) spill_regno < lra_constraint_new_regno_start - ? "" - : bitmap_bit_p (&lra_inheritance_pseudos, spill_regno) - ? "inheritance " - : bitmap_bit_p (&lra_split_regs, spill_regno) - ? "split " - : bitmap_bit_p (&lra_optional_reload_pseudos, spill_regno) - ? "optional reload " : "reload "), + pseudo_prefix_title (spill_regno), spill_regno, reg_renumber[spill_regno], lra_reg_info[spill_regno].freq, regno); update_lives (spill_regno, true); @@ -1176,6 +1177,7 @@ assign_by_spills (void) bitmap_initialize (&changed_insns, ®_obstack); bitmap_initialize (&non_reload_pseudos, ®_obstack); bitmap_ior (&non_reload_pseudos, &lra_inheritance_pseudos, &lra_split_regs); + bitmap_ior_into (&non_reload_pseudos, &lra_subreg_reload_pseudos); bitmap_ior_into (&non_reload_pseudos, &lra_optional_reload_pseudos); for (iter = 0; iter <= 1; iter++) { @@ -1350,6 +1352,7 @@ assign_by_spills (void) && lra_reg_info[i].restore_regno >= 0) || (bitmap_bit_p (&lra_split_regs, i) && lra_reg_info[i].restore_regno >= 0) + || bitmap_bit_p (&lra_subreg_reload_pseudos, i) || bitmap_bit_p (&lra_optional_reload_pseudos, i)) && reg_renumber[i] < 0 && lra_reg_info[i].nrefs != 0 && regno_allocno_class_array[i] != NO_REGS) |