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

login
register
mail settings
Submitter Vladimir Makarov
Date Aug. 2, 2011, 7:49 p.m.
Message ID <4E3854CB.1020402@redhat.com>
Download mbox | patch
Permalink /patch/107988/
State New
Headers show

Comments

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

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]))))
             {