Page MenuHomePhabricator

[AArch64][SME] Implement ABI for calls to/from streaming functions.
ClosedPublic

Authored by sdesmalen on Aug 10 2022, 8:15 AM.

Details

Summary

This patch implements the ABI for calls from:

Normal -> Streaming
Normal -> Streaming-compatible
Streaming -> Normal
Streaming -> Streaming-compatible
Streaming -> Streaming

The compiler inserts SMSTART/SMSTOP instructions before and after the call,
depending on the required transition.

More details about the SME attributes and design can be found
in D131562.

Diff Detail

Event Timeline

sdesmalen created this revision.Aug 10 2022, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 8:15 AM
sdesmalen requested review of this revision.Aug 10 2022, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 8:15 AM
kmclaughlin added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.h
569–570

I think this change might have escaped from D131578 :)

aemerson added inline comments.Thu, Sep 8, 12:29 PM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4524

Why not just use StringRef to compare?

t.p.northover added inline comments.Fri, Sep 9, 3:42 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
6796

Any idea which review this appears in? I can't find the implementation.

aemerson added inline comments.Fri, Sep 9, 3:52 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
6796

It's from D131570

sdesmalen updated this revision to Diff 460221.Wed, Sep 14, 2:07 PM

Replaced:

bool IsStreamingCompatibleExternalFunction(SDValue V)

By:

Optional<SMEAttrs> getCalleeAttrsFromExternalFunction(SDValue V)
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4524

This was more to write it in an extensible way such that other cases can be added later. I've rewritten this a bit now to support ZA as well.

sdesmalen marked an inline comment as done.Wed, Sep 14, 2:08 PM
aemerson accepted this revision.Wed, Sep 14, 2:10 PM

LGTM.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4524

Ah ok, feel free to change it back then.

This revision is now accepted and ready to land.Wed, Sep 14, 2:10 PM
This revision was landed with ongoing or failed builds.Fri, Sep 16, 7:08 AM
This revision was automatically updated to reflect the committed changes.