This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Always allocate a lazy-save buffer if a function has ZA state.
ClosedPublic

Authored by sdesmalen on Nov 17 2022, 7:03 AM.

Details

Summary

We already do this for most cases, with the exception of instructions that
get expanded to function calls (e.g. for lowering operations on fp128
values), in which case we temporarily allocate a lazy-save buffer.

The code that is generated in this case, is however incorrect, as it seems
to pass an incorrect address for the TPIDR2 object to the ZA restore
function. By always allocating the lazy-save buffer once, we avoid this
issue entirely.

The cost is that we also allocate such a buffer when it is not
needed. We could fix that in a follow-up patch, where we remove the
lazy-save buffer when it isn't used.

Diff Detail

Event Timeline

sdesmalen created this revision.Nov 17 2022, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 7:03 AM
sdesmalen requested review of this revision.Nov 17 2022, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 7:03 AM
paulwalker-arm accepted this revision.Nov 18 2022, 3:51 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
6431–6432

What about "Conservatively assume the function requires the lazy-save mechanism."?

This revision is now accepted and ready to land.Nov 18 2022, 3:51 AM
This revision was landed with ongoing or failed builds.Nov 21 2022, 8:33 AM
This revision was automatically updated to reflect the committed changes.