[lra] one more patch to decrease ARM code size degradation

Submitted by Vladimir Makarov on Aug. 2, 2011, 7:49 p.m.

Details

Message ID 4E3854CB.1020402@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov Aug. 2, 2011, 7:49 p.m.
The following patch decreases ARM code size degradation for LRA.  It 
permits achieve practically the same SPECINT2000 code size on ARM as for 
reload (there is still small ARM code size degradation on SPECFP2000).

The patch was successfully bootstrapped on x86-64.

2011-08-02  Vladimir Makarov <vmakarov@redhat.com>

         * lra-assigns.c (find_hard_regno_for): Don't do hard register
         usage leveling for targets with conditional execution.

               best_hard_regno = hard_regno;

Patch hide | download patch | download mbox

Index: lra-assigns.c
===================================================================
--- lra-assigns.c       (revision 176950)
+++ lra-assigns.c       (working copy)
@@ -428,7 +428,12 @@  find_hard_regno_for (int regno, int *cos
           if (best_hard_regno < 0 || hard_regno_costs[hard_regno] < 
best_cost
               || (hard_regno_costs[hard_regno] == best_cost
&& (bank < best_bank
-                     || (bank == best_bank
+                     /* Hard register usage leveling actually results
+                        in bigger code for targets with conditional
+                        execution like ARM because it reduces chance
+                        of if-conversion after LRA.  */
+                     || (! targetm.have_conditional_execution ()
+ && bank == best_bank
&& best_usage > lra_hard_reg_usage[hard_regno]))))
             {