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 <vmaka...@redhat.com>

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

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]))))
            {
              best_hard_regno = hard_regno;

Reply via email to