[PATCH] D131571: [AArch64][SME] Fix lowering of llvm.aarch64.get.pstatesm()

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 07:44:40 PDT 2022


sdesmalen created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
sdesmalen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A thread may not have access to SME or TPIDR2_EL0, so in order to
safely query PSTATE.SM in a streaming-compatible function, the
code should call `__arm_sme_state()`, as described in the ABI:

  https://github.com/ARM-software/abi-aa/pull/123/commits/c2bb09c4d4ee60a5787baf1ccc7e92e67e4240b7

This means that the value of pstate.sm is:

- 0 if the function is non-streaming.
- 1 if the function has `arm_streaming` or `arm_locally_streaming`.
- evaluated at runtime by a call to __arm_sme_state() otherwise.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131571

Files:
  llvm/include/llvm/IR/CallingConv.h
  llvm/lib/Target/AArch64/AArch64CallingConvention.td
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
  llvm/test/CodeGen/AArch64/sme-get-pstatesm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131571.451456.patch
Type: text/x-patch
Size: 10561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220810/35e2cd57/attachment.bin>


More information about the llvm-commits mailing list