This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Make stack tagging compatible with SLH
ClosedPublic

Authored by kristof.beyls on Apr 17 2023, 2:44 AM.

Details

Summary

See https://github.com/llvm/llvm-project/issues/61830

Speculative Load Hardening (SLH) requires that conditional branches are
implemented using B.cc branches, not using {TC}B{N}Z branches.

Stack tagging was expanding one of the pseudo instructions it uses to
cbnz. This commit changes that to use b.ne instead.

Note that the added regression test was added to settag.ll rather than
speculation-hardening.ll. The speculation-hardening.ll tests also check
that all tests in the file work with global-isel. It seems that stack
tagging does not work yet with global-isel. Therefore, testing the
combination of stack tagging and SLH hard to be added to a test file
that doesn't test global-isel, i.e. settag.ll

Diff Detail

Event Timeline

kristof.beyls created this revision.Apr 17 2023, 2:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2023, 2:44 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
kristof.beyls requested review of this revision.Apr 17 2023, 2:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2023, 2:44 AM
This revision is now accepted and ready to land.Apr 20 2023, 1:46 AM
This revision was automatically updated to reflect the committed changes.

LGTM, thanks!