[ARM] Tweak HONOR_REG_ALLOC_ORDER
diff mbox series

Message ID VI1PR0801MB21274DB91E8E5300709B246F83B70@VI1PR0801MB2127.eurprd08.prod.outlook.com
State New
Headers show
Series
  • [ARM] Tweak HONOR_REG_ALLOC_ORDER
Related show

Commit Message

Wilco Dijkstra Sept. 9, 2019, 5:04 p.m. UTC
Setting HONOR_REG_ALLOC_ORDER improves codesize with -Os, however it generates
slower and larger code with -O2 and higher.  So only set it when optimizing for
size.  On Cortex-A57 this improves SPECINT2006 by 0.15% and SPECFP2006 by 0.25%
while reducing codesize.

Bootstrap OK, OK for commit?

ChangeLog:
2019-09-09  Wilco Dijkstra  <wdijkstr@arm.com>

	* config/arm/arm.h (HONOR_REG_ALLOC_ORDER): Set when optimizing for size.

--

Patch
diff mbox series

diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 8d023389eec469ad9c8a4e88edebdad5f3c23769..e3473e29fbbb964ff1136c226fbe30d35dbf7b39 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1065,9 +1065,8 @@  extern int arm_regs_in_sequence[];
 /* Use different register alloc ordering for Thumb.  */
 #define ADJUST_REG_ALLOC_ORDER arm_order_regs_for_local_alloc ()
 
-/* Tell IRA to use the order we define rather than messing it up with its
-   own cost calculations.  */
-#define HONOR_REG_ALLOC_ORDER 1
+/* Tell IRA to use the order we define when optimizing for size.  */
+#define HONOR_REG_ALLOC_ORDER optimize_size
 
 /* Interrupt functions can only use registers that have already been
    saved by the prologue, even if they would normally be