Improve aarch64_legitimize_address - avoid splitting the offset if it is
commit5ca92351fb4b3df9d47260200d52af10e2fbd49e
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Sep 2016 14:56:59 +0000 (7 14:56 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Sep 2016 14:56:59 +0000 (7 14:56 +0000)
treeec1572aa2f7fba6f3e827f68a120f7bdd0368c78
parentb55f1f446d96b97ed5370997c04ce94483835a87
Improve aarch64_legitimize_address - avoid splitting the offset if it is
supported.  When we do split, take the mode size into account.  BLKmode
falls into the unaligned case but should be treated like LDP/STP.
This improves codesize slightly due to fewer base address calculations:

int f(int *p) { return p[5000] + p[7000]; }

Now generates:

f:
add x0, x0, 16384
ldr w1, [x0, 3616]
ldr w0, [x0, 11616]
add w0, w1, w0
ret

instead of:

f:
add x1, x0, 16384
add x0, x0, 24576
ldr w1, [x1, 3616]
ldr w0, [x0, 3424]
add w0, w1, w0
ret

    gcc/
* config/aarch64/aarch64.c (aarch64_legitimize_address):
Avoid use of base_offset if offset already in range.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240026 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c