[all-commits] [llvm/llvm-project] 7d4659: [mlir][llvm] Add arm_streaming LLVM function attri...

Cullen Rhodes via All-commits all-commits at lists.llvm.org
Thu May 25 02:21:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d4659095aa535f1f2bbc01a094b86907863b1ce
      https://github.com/llvm/llvm-project/commit/7d4659095aa535f1f2bbc01a094b86907863b1ce
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/lib/Target/LLVMIR/ModuleImport.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Integration/Dialect/Vector/CPU/ArmSME/test-ssve.mlir
    M mlir/test/Target/LLVMIR/Import/function-attributes.ll
    R mlir/test/Target/LLVMIR/arm-ssve.mlir
    M mlir/test/Target/LLVMIR/llvmir.mlir

  Log Message:
  -----------
  [mlir][llvm] Add arm_streaming LLVM function attributes

This patch adds two optional attributes to 'llvm.func' op for the Armv9
Streaming SVE (SSVE) mode [1] that map 1-1 with LLVM function attributes [2]:

  * arm_streaming -> aarch64_pstate_sm_enabled
  * arm_locally_streaming -> aarch64_pstate_sm_body

Streaming-mode is part of the interface (ABI) for functions with the
first attribute and it's the responsibility of the caller to manage
PSTATE.SM on entry/exit to functions with this attribute [3]. The LLVM
backend will emit 'smstart sm' / 'smstop sm' [4] around calls to
streaming functions.

In locally streaming functions PSTATE.SM is kept internal and managed by
the callee on entry/exit. The LLVM backend will emit 'smstart sm' /
'smstop sm' in the prologue / epilogue for functions with this
attribute.

The integration test for SSVE has been updated to no longer use the
passthrough mechanism that's intended for prototyping.

PATCH [1 / 2] in series for RFC: https://discourse.llvm.org/t/rfc-supporting-armv9-scalable-matrix-extension-sme-streaming-sve-ssve-mode-in-mlir/70678

[1] https://developer.arm.com/documentation/ddi0616/aa
[2] https://llvm.org/docs/AArch64SME.html#introduction
[3] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#671pstatesm-interfaces
[4] https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/SMSTART--Enables-access-to-Streaming-SVE-mode-and-SME-architectural-state--an-alias-of-MSR--immediate--

Reviewed By: awarzynski, dcaballe, WanderAway

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


  Commit: 12648492998bd22d268eb1d4d476c6c3acc6c43d
      https://github.com/llvm/llvm-project/commit/12648492998bd22d268eb1d4d476c6c3acc6c43d
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    A mlir/include/mlir/Dialect/ArmSME/CMakeLists.txt
    A mlir/include/mlir/Dialect/ArmSME/Transforms/CMakeLists.txt
    A mlir/include/mlir/Dialect/ArmSME/Transforms/Passes.h
    A mlir/include/mlir/Dialect/ArmSME/Transforms/Passes.td
    M mlir/include/mlir/Dialect/CMakeLists.txt
    M mlir/include/mlir/InitAllPasses.h
    A mlir/lib/Dialect/ArmSME/CMakeLists.txt
    A mlir/lib/Dialect/ArmSME/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/ArmSME/Transforms/EnableArmStreaming.cpp
    M mlir/lib/Dialect/CMakeLists.txt
    A mlir/test/Dialect/ArmSME/enable-arm-streaming.mlir

  Log Message:
  -----------
  [mlir] Add pass to enable Armv9 Streaming SVE mode

This patch adds a pass 'enable-arm-streaming' that enables the Armv9
Scalable Matrix Extension (SME) Streaming SVE (SSVE) mode [1] by adding
either of the following attributes to 'func.func' ops:

  * arm_streaming (default)
  * arm_locally_streaming

PATCH [2 / 2] in series for RFC: https://discourse.llvm.org/t/rfc-supporting-armv9-scalable-matrix-extension-sme-streaming-sve-ssve-mode-in-mlir/70678

[1] https://developer.arm.com/documentation/ddi0616/aa

Reviewed By: awarzynski, dcaballe

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


Compare: https://github.com/llvm/llvm-project/compare/89242ed6a28b...12648492998b


More information about the All-commits mailing list