[all-commits] [llvm/llvm-project] 3b4b6c: [mlir][ArmSME] Add move vector to tile slice op an...

Cullen Rhodes via All-commits all-commits at lists.llvm.org
Tue Aug 29 02:38:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b4b6cbba5e04fc6bbbba4a034176aa4039a73a6
      https://github.com/llvm/llvm-project/commit/3b4b6cbba5e04fc6bbbba4a034176aa4039a73a6
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td
    M mlir/lib/Conversion/VectorToArmSME/VectorToArmSME.cpp
    M mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
    M mlir/test/Dialect/ArmSME/arith-ops-to-sme.mlir
    M mlir/test/Dialect/ArmSME/invalid.mlir
    M mlir/test/Dialect/ArmSME/roundtrip.mlir
    A mlir/test/Integration/Dialect/Vector/CPU/ArmSME/tile_fill.mlir

  Log Message:
  -----------
  [mlir][ArmSME] Add move vector to tile slice op and lowerings

This adds a 'move_vector_to_tile_slice' op to the ArmSME dialect that
moves a 1-D scalable vector to a slice of a 2-D tile at a given index.

This is lowered to the 'llvm.aarch64.sme.write.horiz' intrinsic that
maps to the MOVA (vector to tile, single) SME instruction [1] when
lowering to LLVM. Like the SME load and store instructions this operates
on ZA tile slices, which are 1D vectors of horizontally or vertically
contiguous elements within a ZA tile.

This patch extends the lowering of 'arith.constant' to SME to support
non-zero constants using this new op.  This requires materializing a
loop that broadcasts the constant to each tile slice with the
'vector_to_tile_slice' op. Unlike load and store, this is done during
conversion from Vector to ArmSME, rather than ArmSME to SCF. The latter
would require a higher-level custom op in the ArmSME dialect like
'tile_load' and 'tile_store' and this isn't necessary. We may also
remove the load and store ops in the future in favour of lowering
straight from Vector, at which point this would converge.

Currently only horizontal tile slices are supported. A future patch will
extend this mechanism to support 'vector.broadcast'.

Depends on D156980 D157004

[1] https://developer.arm.com/documentation/ddi0602

Reviewed By: awarzynski, dcaballe

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




More information about the All-commits mailing list