[all-commits] [llvm/llvm-project] a4d87e: [mlir][ArmSME] Calculate correct tile mask when lo...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Fri Aug 18 02:35:53 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4d87e3d0655675318d2b4e420afaea65afa8f55
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
    A mlir/test/Dialect/ArmSME/tile-zero-masks.mlir
    M mlir/test/Dialect/ArmSME/vector-ops-to-llvm.mlir

  Log Message:
  [mlir][ArmSME] Calculate correct tile mask when lowering arm_sme.zero

This patch updates the lowering of the arm_sme.zero to intrinsics so
that it calculates the correct mask for the tile to zero.

The zero instruction takes an 8-bit mask which specifies which 64-bit
tiles to zero, ZA0.D to ZA7.D correspond to bits 0 to 7. To zero tiles
with element sizes of 8-bit to 32-bit just requires zeroing the right
64-bit tiles.

This is quite easy to calculate, each size has a "base mask" which can
be shifted left by the tile ID to get the mask for that tile.

  base_mask << tile_id

After tile allocation, this will be folded to a constant mask.

Reviewed By: awarzynski

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

More information about the All-commits mailing list