[ARM] Enable arm_legitimize_address for Thumb-2
diff mbox series

Message ID VI1PR0801MB2127489F3E96E2747653A3CF83B70@VI1PR0801MB2127.eurprd08.prod.outlook.com
State New
Headers show
  • [ARM] Enable arm_legitimize_address for Thumb-2
Related show

Commit Message

Wilco Dijkstra Sept. 9, 2019, 5:02 p.m. UTC
Currently arm_legitimize_address doesn't handle Thumb-2 at all, resulting in
inefficient code.  Since Thumb-2 supports similar address offsets use the Arm
legitimization code for Thumb-2 to get significant codesize and performance
gains.  SPECINT2006 shows 0.4% gain on Cortex-A57, while SPECFP improves 0.2%.

Bootstrap OK, OK for commit?

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

	* config/arm/arm.c (arm_legitimize_address): Remove Thumb-2 bailout.


diff mbox series

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a5a6a0fab1b4b7ef07931522e7d47e59842d7f27..2601708e7e0716e4668b79e015e366d2164562fd 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -8652,13 +8652,8 @@  arm_legitimize_address (rtx x, rtx orig_x, machine_mode mode)
 	return x;
-  if (!TARGET_ARM)
-    {
-      /* TODO: legitimize_address for Thumb2.  */
-      if (TARGET_THUMB2)
-        return x;
-      return thumb_legitimize_address (x, orig_x, mode);
-    }
+    return thumb_legitimize_address (x, orig_x, mode);
   if (GET_CODE (x) == PLUS)