[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
authorPablo Barrio <pablo.barrio@arm.com>
Fri, 10 Jan 2020 17:51:21 +0000 (17:51 +0000)
committerPablo Barrio <pablo.barrio@arm.com>
Mon, 13 Jan 2020 14:14:48 +0000 (14:14 +0000)
commitda33762de8531914d4d0dae16bfce2192f02bc79
treefa3f12ab4dffa0ecdb68d2204f26825081e2ed75
parent8e8ccf4712cf58562a91c197da3efd4f9963ce0d
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below

Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.

The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.

Reviewers: samparker, chill, LukeCheeseman

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71658
13 files changed:
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-cfi.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-diff-scope-same-key.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-non-leaf.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-diff-key.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-a.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-b.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-subtarget.ll
llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll
llvm/test/CodeGen/AArch64/sign-return-address.ll
llvm/test/CodeGen/AArch64/speculation-hardening-dagisel.ll
llvm/test/CodeGen/AArch64/speculation-hardening-loads.ll
llvm/test/MC/AArch64/armv8.3a-signed-pointer.s