[PATCH] D76014: [mlir][Vector]Lower vector.contract to llvm.intr.matrix_multiply

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 11:19:21 PDT 2020


nicolasvasilache created this revision.
nicolasvasilache added reviewers: aartbik, fhahn.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.

This revision adds lowering of vector.contract to llvm.intr.matrix_multiply.
Note that there is currently a mismatch between the MLIR vector dialect which expects row-major layout and the LLVM matrix intrinsics which expect column major layout.

As a consequence, we currently only match a vector.contract with indexing maps
that express column-major matrix multiplication.
Other cases would require additional transposes and it is better to wait for
LLVM intrinsics to provide a per-operation attribute that would specify which layout is expected.

A separate integration test, not submitted to MLIR core, has independently verified that correct execution occurs on a 2x2x2 matrix multiplication.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76014

Files:
  mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
  mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
  mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp
  mlir/lib/Dialect/VectorOps/VectorTransforms.cpp
  mlir/test/Dialect/VectorOps/vector-contract-transforms.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76014.249693.patch
Type: text/x-patch
Size: 10812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200311/4a1ce47d/attachment.bin>


More information about the llvm-commits mailing list