Page MenuHomePhabricator

[AArch64] Save LR (x30) across statepoint calls
Needs ReviewPublic

Authored by cypheon on Aug 2 2021, 11:10 AM.

Details

Summary

On AArch64, the statepoint instruction clobbers LR (x30) because it eventually gets tunred into a BL instruction.
This is an attempt to correctly mark the register as clobbered while being less invasive than the previous approach (https://reviews.llvm.org/D74902).
The related test is also updated to verify that LR (x30) is correctly saved and restored across statepoint calls.

Related bug: https://bugs.llvm.org/show_bug.cgi?id=50553

Diff Detail

Unit TestsFailed

TimeTest
1,360 msx64 debian > MemProfiler-x86_64-linux.TestCases::test_new_load_store.cpp
Script: -- : 'RUN: at line 5'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/memprof/TestCases/test_new_load_store.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/memprof/X86_64LinuxConfig/TestCases/Output/test_new_load_store.cpp.tmp

Event Timeline

cypheon created this revision.Aug 2 2021, 11:10 AM
cypheon requested review of this revision.Aug 2 2021, 11:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 11:10 AM

I don't feel comfortable reviewing this as I don't have the AArch64 context. I will comment that the addition of another operand to the MI just to effect the MC lowering seems... suspect.

[...] I will comment that the addition of another operand to the MI just to effect the MC lowering seems... suspect.

Do you have any hint for me where a more appropriate place might be (or just in which direction I should look)? I searched several other places but since almost all of the statepoint infrastructure is target-independent, I didn't find a better place to do this.

Thanks for commenting!