This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
ClosedPublic

Authored by pbarrio on Dec 18 2019, 5:30 AM.

Details

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.

Diff Detail

Event Timeline

pbarrio created this revision.Dec 18 2019, 5:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2019, 5:30 AM
This revision is now accepted and ready to land.Jan 3 2020, 12:46 AM
pbarrio updated this revision to Diff 237623.Jan 13 2020, 4:05 AM

Updated tests and rebase conflict with new "isAuthenticated" predicate

This revision was automatically updated to reflect the committed changes.