rs6000: Improve indexed addressing
authorSegher Boessenkool <segher@kernel.crashing.org>
Mon, 1 Jul 2019 15:15:41 +0000 (17:15 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Mon, 1 Jul 2019 15:15:41 +0000 (17:15 +0200)
commitb94eec3beaf19d2bace6f4f2018d9e0bd1981f56
tree0b7ddf6017519fecd267146cbf9d0b6c304299f0
parentd5c15d688abd1aca27202e690cc13f686051c116
rs6000: Improve indexed addressing

The function rs6000_force_indexed_or_indirect_mem makes a memory
operand suitable for indexed (or indirect) addressing.  If the memory
address isn't yet valid, it loads the whole thing into a register to
make it valid.  That isn't optimal.  This changes it to load an
address that is the sum of two things into two registers instead.
This results in lower latency code, and if inside loops, a constant
term can be moved outside the loop.

* config/rs6000/rs6000.c (rs6000_force_indexed_or_indirect_mem):
Load both operands of a PLUS into registers separately.

From-SVN: r272886
gcc/ChangeLog
gcc/config/rs6000/rs6000.c