This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Save LR (x30) across statepoint calls
AbandonedPublic

Authored by reames 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

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!

Hi, Philip Reames mentioned this patch in the review of my patch https://reviews.llvm.org/D111114. It looks like we independently came up to the same solution.
This solution looks like a workaround for impossibility in td file to override the list of implicit defs of pseudo instruction STATEPOINT in target-dependent td file.

I guess there are two ways to go forward:

  1. Find some expert in td files which can review this patch and say whether this overriding is possible or how to extend td handling to support this overriding.

If it is too complex we need to understand whether it makes sense or (2)

  1. Go with this solution.

I sent a question to llvm-dev....

reames commandeered this revision.Nov 30 2021, 9:54 AM
reames edited reviewers, added: cypheon; removed: reames.
reames abandoned this revision.Nov 30 2021, 9:54 AM