This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Set fn attributes correctly on __arm_tpidr2_save call.
ClosedPublic

Authored by sdesmalen on Oct 20 2022, 5:34 AM.

Details

Summary

Changing the way the attribute is created changes the way the attribute
is added. Now it seems to be correctly added as a function attribute, whereas
before it was not. This led ISel ignoring attributes and setting up a lazy-save
buffer for the call to __arm_tpidr2_save.

This patch also marks the intrinsic call as 'preserves_za' which together with the
above prevents the code-generator from setting up a lazy-save buffer.

Diff Detail

Event Timeline

sdesmalen created this revision.Oct 20 2022, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 5:34 AM
sdesmalen requested review of this revision.Oct 20 2022, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 5:34 AM
kmclaughlin accepted this revision.Oct 27 2022, 10:32 AM
This revision is now accepted and ready to land.Oct 27 2022, 10:32 AM
aemerson added inline comments.Oct 27 2022, 11:39 AM
llvm/lib/Target/AArch64/SMEABIPass.cpp
68

No objections to the patch but I'm a bit confused why this didn't work? Seems like a footgun to me.

sdesmalen added inline comments.Oct 28 2022, 12:34 AM
llvm/lib/Target/AArch64/SMEABIPass.cpp
68

I was similarly surprised. Perhaps there is some subtle difference that by adding it with the above interface, the attribute was somehow not a function attribute?
But then I don't know what kind of attribute it would be, or what the attribute applies to, given that it's still attached to a function.