Hi, this patch avoids emitting LA on z13 and later when the address has both an index and a base since a regular add is faster in that case.
Regtested on s390x. Regards Robin -- gcc/ChangeLog: 2018-07-05 Robin Dapp <rd...@linux.ibm.com> * config/s390/s390.c (preferred_la_operand_p): Do not use LA with base and index on z13 or later.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 5add5985866..df9357fa9e5 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -4630,6 +4630,11 @@ preferred_la_operand_p (rtx op1, rtx op2) if (addr.indx && s390_tune == PROCESSOR_2817_Z196) return false; + /* Avoid LA when the address has index as well as base registers, + a regular add is still faster then. */ + if (addr.base && addr.indx && s390_tune >= PROCESSOR_2964_Z13) + return false; + if (!TARGET_64BIT && !addr.pointer) return false;