]> granicus.if.org Git - llvm/commit
AArch64: Unify relocation restrictions between MOVK/MOVN/MOVZ.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Jul 2019 16:51:53 +0000 (16:51 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Jul 2019 16:51:53 +0000 (16:51 +0000)
commitba8e07e470f7041425192597ba8d72932580162c
treefda899cb76cf4b365118a082cd7295a7877e8499
parent0c200332099f472398b6c7f087089f438d9469bb
AArch64: Unify relocation restrictions between MOVK/MOVN/MOVZ.

There doesn't seem to be a practical reason for these instructions to have
different restrictions on the types of relocations that they may be used
with, notwithstanding the language in the ELF AArch64 spec that implies that
specific relocations are meant to be used with specific instructions.

For example, we currently forbid the first instruction in the following
sequence, despite it currently being used by clang to generate a global
reference under -mcmodel=large:

movz x0, #:abs_g0_nc:foo
movk x0, #:abs_g1_nc:foo
movk x0, #:abs_g2_nc:foo
movk x0, #:abs_g3:foo

Therefore, allow MOVK/MOVN/MOVZ to accept the union of the set of relocations
that they currently accept individually.

Differential Revision: https://reviews.llvm.org/D64466

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366461 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64InstrFormats.td
lib/Target/AArch64/AArch64InstrInfo.td
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
test/MC/AArch64/basic-a64-diagnostics.s