diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-07-26 09:48:24 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-07-26 09:48:24 +0000 |
commit | 2da068d5c04c748a27fa0694eb00bb385bac13aa (patch) | |
tree | 3006f2eb1a6828336e2725fb1905e24df6ea07f6 /gcc | |
parent | 093a6c996efdb16e7cf20f2677dbe128e618031d (diff) | |
download | gcc-2da068d5c04c748a27fa0694eb00bb385bac13aa.zip gcc-2da068d5c04c748a27fa0694eb00bb385bac13aa.tar.gz gcc-2da068d5c04c748a27fa0694eb00bb385bac13aa.tar.bz2 |
ira-costs.c (find_costs_and_classes): For -O0...
gcc/
* ira-costs.c (find_costs_and_classes): For -O0, use the best class
as the allocation class if it isn't likely to be spilled.
From-SVN: r213078
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ira-costs.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6cf5364..1750691 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-07-26 Richard Sandiford <rdsandiford@googlemail.com> + * ira-costs.c (find_costs_and_classes): For -O0, use the best class + as the allocation class if it isn't likely to be spilled. + +2014-07-26 Richard Sandiford <rdsandiford@googlemail.com> + * rtl.h (tls_referenced_p): Declare. * rtlanal.c (tls_referenced_p_1, tls_referenced_p): New functions. * config/mips/mips.c (mips_tls_symbol_ref_1): Delete. diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index a83e1df..13bbf07 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1753,6 +1753,20 @@ find_costs_and_classes (FILE *dump_file) alt_class = ira_allocno_class_translate[alt_class]; if (best_cost > i_mem_cost) regno_aclass[i] = NO_REGS; + else if (!optimize && !targetm.class_likely_spilled_p (best)) + /* Registers in the alternative class are likely to need + longer or slower sequences than registers in the best class. + When optimizing we make some effort to use the best class + over the alternative class where possible, but at -O0 we + effectively give the alternative class equal weight. + We then run the risk of using slower alternative registers + when plenty of registers from the best class are still free. + This is especially true because live ranges tend to be very + short in -O0 code and so register pressure tends to be low. + + Avoid that by ignoring the alternative class if the best + class has plenty of registers. */ + regno_aclass[i] = best; else { /* Make the common class the biggest class of best and |