summaryrefslogtreecommitdiff
path: root/gcc/lra.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-09 19:40:09 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-09 19:40:09 +0000
commit0f7b6a0db4f251a303fad7a68d0d6515e677a050 (patch)
tree9684a6d40e6a42b869a0f236d04ab6c6882b0ca8 /gcc/lra.c
parent01b65dcf9a3683a753d52d44fc2ceb051374aa3a (diff)
downloadgcc-0f7b6a0db4f251a303fad7a68d0d6515e677a050.tar.gz
2015-04-09 Vladimir Makarov <vmakarov@redhat.com>
PR target/65710 * lra-int.h (lra_bad_spill_regno_start): New. * lra.c (lra_bad_spill_regno_start): New. (lra): Set up lra_bad_spill_regno_start. Set up lra_constraint_new_regno_start unconditionally. * lra-assigns.c (spill_for): Use lra_bad_spill_regno_start for spill preferences. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221956 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra.c')
-rw-r--r--gcc/lra.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/lra.c b/gcc/lra.c
index a29266e7ecc..f4d7a3c071f 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2180,6 +2180,10 @@ int lra_new_regno_start;
/* Start of reload pseudo regnos before the new spill pass. */
int lra_constraint_new_regno_start;
+/* Avoid spilling pseudos with regno more than the following value if
+ it is possible. */
+int lra_bad_spill_regno_start;
+
/* Inheritance pseudo regnos before the new spill pass. */
bitmap_head lra_inheritance_pseudos;
@@ -2269,6 +2273,7 @@ lra (FILE *f)
permit changing reg classes for pseudos created by this
simplification. */
lra_constraint_new_regno_start = lra_new_regno_start = max_reg_num ();
+ lra_bad_spill_regno_start = INT_MAX;
remove_scratches ();
scratch_p = lra_constraint_new_regno_start != max_reg_num ();
@@ -2406,12 +2411,14 @@ lra (FILE *f)
/* Assignment of stack slots changes elimination offsets for
some eliminations. So update the offsets here. */
lra_eliminate (false, false);
- /* After switching off inheritance and rematerialization passes,
- don't forget reload pseudos after spilling sub-pass to avoid
- LRA cycling in some complicated cases. */
- if (lra_inheritance_iter <= LRA_MAX_INHERITANCE_PASSES
- || lra_rematerialization_iter <= LRA_MAX_REMATERIALIZATION_PASSES)
- lra_constraint_new_regno_start = max_reg_num ();
+ lra_constraint_new_regno_start = max_reg_num ();
+ if (lra_bad_spill_regno_start == INT_MAX
+ && lra_inheritance_iter > LRA_MAX_INHERITANCE_PASSES
+ && lra_rematerialization_iter > LRA_MAX_REMATERIALIZATION_PASSES)
+ /* After switching off inheritance and rematerialization
+ passes, avoid spilling reload pseudos will be created to
+ prevent LRA cycling in some complicated cases. */
+ lra_bad_spill_regno_start = lra_constraint_new_regno_start;
lra_assignment_iter_after_spill = 0;
}
restore_scratches ();