[all-commits] [llvm/llvm-project] 45d287: [AArch64][SME] Fix lowering of llvm.aarch64.get.ps...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Thu Sep 15 08:16:07 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45d28779c5dc6c8afa6feb24d68606f01b9800f4
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M llvm/include/llvm/AsmParser/LLToken.h
    M llvm/include/llvm/IR/CallingConv.h
    M llvm/lib/AsmParser/LLLexer.cpp
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/Target/AArch64/AArch64CallingConvention.td
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
    M llvm/test/CodeGen/AArch64/sme-get-pstatesm.ll
    A llvm/test/CodeGen/AArch64/sme-support-routines-calling-convention.ll

  Log Message:
  [AArch64][SME] Fix lowering of llvm.aarch64.get.pstatesm()

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:


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.

This patch also adds a calling convention for calls to SME support routines.

At some point we can remove the need for the llvm.aarch64.get.pstatesm() intrinsic
and use function calls (with the corresponding cc) directly instead.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D131571

More information about the All-commits mailing list