summaryrefslogtreecommitdiff
path: root/gcc/lra-assigns.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-18 17:04:10 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-18 17:04:10 +0000
commit8033d76f50e2b3420c9a326ff4e61f2f41fd7bae (patch)
tree51d7c38951680676bb379b4b4a546db8ee29b88b /gcc/lra-assigns.c
parent69c20f286b4a50c45d9ab2408a84876a5724f593 (diff)
downloadgcc-8033d76f50e2b3420c9a326ff4e61f2f41fd7bae.tar.gz
2013-07-18 Vladimir Makarov <vmakarov@redhat.com>
Wei Mi <wmi@google.com> PR rtl-optimization/57878 * lra-assigns.c (assign_by_spills): Move non_reload_pseudos to the top. (reload_pseudo_compare_func): Check nregs first for reload pseudos. 2013-07-18 Wei Mi <wmi@google.com> PR rtl-optimization/57878 * g++.dg/pr57518.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201036 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-assigns.c')
-rw-r--r--gcc/lra-assigns.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c
index b5736268e69..54ffc779f11 100644
--- a/gcc/lra-assigns.c
+++ b/gcc/lra-assigns.c
@@ -116,6 +116,11 @@ struct regno_assign_info
/* Map regno to the corresponding regno assignment info. */
static struct regno_assign_info *regno_assign_info;
+/* All inherited, subreg or optional pseudos created before last spill
+ sub-pass. Such pseudos are permitted to get memory instead of hard
+ regs. */
+static bitmap_head non_reload_pseudos;
+
/* Process a pseudo copy with execution frequency COPY_FREQ connecting
REGNO1 and REGNO2 to form threads. */
static void
@@ -194,6 +199,15 @@ reload_pseudo_compare_func (const void *v1p, const void *v2p)
if ((diff = (ira_class_hard_regs_num[cl1]
- ira_class_hard_regs_num[cl2])) != 0)
return diff;
+ if ((diff
+ = (ira_reg_class_max_nregs[cl2][lra_reg_info[r2].biggest_mode]
+ - ira_reg_class_max_nregs[cl1][lra_reg_info[r1].biggest_mode])) != 0
+ /* The code below executes rarely as nregs == 1 in most cases.
+ So we should not worry about using faster data structures to
+ check reload pseudos. */
+ && ! bitmap_bit_p (&non_reload_pseudos, r1)
+ && ! bitmap_bit_p (&non_reload_pseudos, r2))
+ return diff;
if ((diff = (regno_assign_info[regno_assign_info[r2].first].freq
- regno_assign_info[regno_assign_info[r1].first].freq)) != 0)
return diff;
@@ -1155,7 +1169,6 @@ assign_by_spills (void)
rtx insn;
basic_block bb;
bitmap_head changed_insns, do_not_assign_nonreload_pseudos;
- bitmap_head non_reload_pseudos;
unsigned int u;
bitmap_iterator bi;
bool reload_p;