Page MenuHomePhabricator

[ARM64EC 3/?] Mark reserved registers specific to ARM64EC ABI.
AcceptedPublic

Authored by efriedma on May 11 2022, 1:32 PM.

Details

Reviewers
dpaoliello
Summary

Part of patchset to add initial support for ARM64EC.

I'm not completely sure I understand the reason for this restriction, but Microsoft documentation says that asynchronous signals clobber these registers, so we can't ever use them.

As far as I know, none of these registers have any hardcoded meaning, so reserving them shouldn't have any significant side-effects.

Diff Detail

Unit TestsFailed

TimeTest
60,050 msx64 debian > ThreadSanitizer-x86_64.ThreadSanitizer-x86_64::restore_stack.cpp
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -msse4.2 -gline-tables-only -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/../ -std=c++11 -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/../ -O1 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/restore_stack.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/tsan/X86_64Config/Output/restore_stack.cpp.tmp && not /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/tsan/X86_64Config/Output/restore_stack.cpp.tmp 2>&1 | FileCheck /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/restore_stack.cpp

Event Timeline

efriedma created this revision.May 11 2022, 1:32 PM
efriedma requested review of this revision.May 11 2022, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2022, 1:32 PM
mstorsjo added inline comments.
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
335

The comment says v16-v31 but the code seems to go from 15 to 31 - is that a typo? (Based on the comment in the testcase, the code is right and the comment above is the one that is wrong.)

efriedma added inline comments.May 11 2022, 4:36 PM
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
335

Microsoft docs say v16-v31. Will fix.

DavidSpickett added inline comments.
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
335

Are you using the "B" name here so that all the various size registers up to "V" get marked as reserved too? (if not you could use "V" to match the comment)

efriedma added inline comments.May 12 2022, 10:11 AM
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
335

Yes, using the "B" name so markSuperRegs finds all the registers.

efriedma updated this revision to Diff 429078.May 12 2022, 2:28 PM
efriedma marked 2 inline comments as done.

Fix v15/v16 confusion

dpaoliello accepted this revision.Tue, May 31, 10:28 AM
dpaoliello added a subscriber: dpaoliello.

You may also want to use the exiting llvm/test/CodeGen/AArch64/arm64-platform-reg.ll test case.

This revision is now accepted and ready to land.Tue, May 31, 10:28 AM