diff options
author | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-07-18 17:04:10 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-07-18 17:04:10 +0000 |
commit | bc404e1b8c6c0a6edb2be4e840619e6992eef0bd (patch) | |
tree | 51d7c38951680676bb379b4b4a546db8ee29b88b /gcc/lra-assigns.c | |
parent | d675843fa61423a8da33fb2cab4f7b82b19835f5 (diff) | |
download | gcc-bc404e1b8c6c0a6edb2be4e840619e6992eef0bd.tar.gz |
[multiple changes]
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.
From-SVN: r201036
Diffstat (limited to 'gcc/lra-assigns.c')
-rw-r--r-- | gcc/lra-assigns.c | 15 |
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; |