AArch64: don't be too greedy when folding :lo12: accesses into mem ops.
authorTim Northover <tnorthover@apple.com>
Tue, 2 Dec 2014 23:13:39 +0000 (23:13 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 2 Dec 2014 23:13:39 +0000 (23:13 +0000)
commit1dad6937c580b3211fb9c014a865ba734e10a32a
treeb7b3f2980d3ecfa254c5a50482add9139d3ff080
parent97be10d98f19d918d1bbd00934d77e021d19b375
AArch64: don't be too greedy when folding :lo12: accesses into mem ops.

This frequently leads to cases like:
   ldr xD, [xN, :lo12:var]
   add xA, xN, :lo12:var
   ldr xD, [xA, #8]

where the ADD would have been needed anyway, and the two distinct addressing
modes can prevent the formation of an ldp. Because of how we handle ADRP
(aggressively forming an ADRP/ADD pseudo-inst at ISel time), this pattern also
results in duplicated ADRP instructions (one on its own to cover the ldr, and
one combined with the add).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223172 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
test/CodeGen/AArch64/arm64-atomic-128.ll
test/CodeGen/AArch64/arm64-variadic-aapcs.ll
test/CodeGen/AArch64/func-argpassing.ll
test/CodeGen/AArch64/func-calls.ll