summaryrefslogtreecommitdiff
path: root/gcc/ira-lives.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2009-07-22 22:00:17 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2009-07-22 22:00:17 +0000
commitdb1a8d988963af9d6891316fc565b5aa38e334be (patch)
treee6debce284f28f6755b99e28e2d7cd846214ef7d /gcc/ira-lives.c
parentcae63f886fb819cd96eafb32964949bc8d6e9a4f (diff)
downloadgcc-db1a8d988963af9d6891316fc565b5aa38e334be.tar.gz
re PR target/37488 (register allocation spills floats needlessly)
2009-07-22 Vladimir Makarov <vmakarov@redhat.com> PR target/37488 * ira-lives.c (bb_has_abnormal_call_pred): New function. (process_bb_node_lives): Use it. * ira.c (setup_cover_and_important_classes): Don't setup ira_important_class_nums. Add cover classes to the end of important classes. (cover_class_order, comp_reg_classes_func, reorder_important_classes): New. (find_reg_class_closure): Use reorder_important_classes. * config/i386/i386.h (IRA_COVER_CLASSES): Remove. * config/i386/i386.c (i386_ira_cover_classes): New function. (TARGET_IRA_COVER_CLASSES): Redefine. * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Add a comment about importance of order of cover classes in the array. From-SVN: r149962
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r--gcc/ira-lives.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 0812c840634..c010f679d37 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -814,6 +814,22 @@ process_single_reg_class_operands (bool in_p, int freq)
}
}
+/* Return true when one of the predecessor edges of BB is marked with
+ EDGE_ABNORMAL_CALL or EDGE_EH. */
+static bool
+bb_has_abnormal_call_pred (basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ {
+ if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
+ return true;
+ }
+ return false;
+}
+
/* Process insns of the basic block given by its LOOP_TREE_NODE to
update allocno live ranges, allocno hard register conflicts,
intersected calls, and register pressure info for allocnos for the
@@ -1062,7 +1078,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
/* No need to record conflicts for call clobbered regs if we
have nonlocal labels around, as we don't ever try to
allocate such regs in this case. */
- if (!cfun->has_nonlocal_label)
+ if (!cfun->has_nonlocal_label && bb_has_abnormal_call_pred (bb))
for (px = 0; px < FIRST_PSEUDO_REGISTER; px++)
if (call_used_regs[px])
make_regno_born (px);