AArch64: Improve GOT addressing
commita195c7270e4705a06a9aaade0d721d5f52ca2275
authorWilco Dijkstra <wdijkstr@arm.com>
Wed, 3 Nov 2021 12:51:41 +0000 (3 12:51 +0000)
committerWilco Dijkstra <wdijkstr@arm.com>
Wed, 3 Nov 2021 13:46:05 +0000 (3 13:46 +0000)
treeabb0b6a8fb3ee012a7af5f3cdcb2cad0f044f30d
parent4096eb50d108a9ccef134f2e891c751b1cc9f6b2
AArch64: Improve GOT addressing

Improve GOT addressing by treating the instructions as a pair.  This reduces
register pressure and improves code quality significantly.  SPECINT2017
improves by 0.6% with -fPIC and codesize is 0.73% smaller.  Perlbench has
0.9% smaller codesize, 1.5% fewer executed instructions and is 1.8% faster
on Neoverse N1.

ChangeLog:
2021-11-02  Wilco Dijkstra  <wdijkstr@arm.com>

* config/aarch64/aarch64.md (movsi): Add alternative for GOT accesses.
(movdi): Likewise.
(ldr_got_small_<mode>): Remove pattern.
(ldr_got_small_sidi): Likewise.
* config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Keep
GOT accesses as moves.
(aarch64_print_operand): Correctly print got_lo12 in L specifier.
(aarch64_mov_operand_p): Make GOT accesses valid move operands.
* config/aarch64/constraints.md: Add new constraint Usw for GOT access.
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/constraints.md