S/390: Do not use LA with index register on z196 or newer.
authorRobin Dapp <rdapp@linux.ibm.com>
Tue, 17 Jul 2018 12:08:06 +0000 (12:08 +0000)
committerRobin Dapp <rdapp@gcc.gnu.org>
Tue, 17 Jul 2018 12:08:06 +0000 (12:08 +0000)
gcc/ChangeLog:

2018-07-17  Robin Dapp  <rdapp@linux.ibm.com>

* config/s390/s390.c (preferred_la_operand_p): Do not use LA with
index register on z196 or later.

From-SVN: r262818

gcc/ChangeLog
gcc/config/s390/s390.c

index 2e04a56a342a0e35292633efb2789a4bd6d28e5b..53c4d24134ab2d7da86f6b5afcac1939a4924aa8 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-17  Robin Dapp  <rdapp@linux.ibm.com>
+
+       * config/s390/s390.c (preferred_la_operand_p): Do not use LA with
+       index register on z196 or later.
+
 2018-07-17  Robin Dapp  <rdapp@linux.ibm.com>
 
        * config/s390/s390.c (s390_default_align): Set default function
index 81f1fbaf894f4b427341dc62e142bbb41f257749..60afe4184832efc51408f555a02c4747ec276c2b 100644 (file)
@@ -4623,11 +4623,11 @@ preferred_la_operand_p (rtx op1, rtx op2)
   if (addr.indx && !REGNO_OK_FOR_INDEX_P (REGNO (addr.indx)))
     return false;
 
-  /* Avoid LA instructions with index register on z196; it is
-     preferable to use regular add instructions when possible.
-     Starting with zEC12 the la with index register is "uncracked"
-     again.  */
-  if (addr.indx && s390_tune == PROCESSOR_2817_Z196)
+  /* Avoid LA instructions with index (and base) register on z196 or
+     later; it is preferable to use regular add instructions when
+     possible.  Starting with zEC12 the la with index register is
+     "uncracked" again but still slower than a regular add.  */
+  if (addr.indx && s390_tune >= PROCESSOR_2817_Z196)
     return false;
 
   if (!TARGET_64BIT && !addr.pointer)