[PATCH] D79468: [mlir][Linalg] Start a LinalgToStandard pass and move conversion to library calls.

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 19:57:55 PDT 2020


nicolasvasilache created this revision.
nicolasvasilache added a reviewer: ftynse.
Herald added subscribers: llvm-commits, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.

This revision starts decoupling the include the kitchen sink behavior of Linalg to LLVM lowering by inserting a -convert-linalg-to-std pass.

The lowering of linalg ops to function calls was previously lowering to memref descriptors by having both linalg -> std and std -> LLVM patterns in the same rewrite.

When separating this step, a new issue occurred: the layout is automatically type-erased by this process. This revision therefore introduces memref casts to perform these type erasures explicitly. To connect everything end-to-end, the LLVM lowering of MemRefCastOp is relaxed because it is artificially more restricted than the op semantics. The op semantics already guarantee that source and target MemRefTypes are cast-compatible. An invalid lowering test now becomes valid and is removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79468

Files:
  mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
  mlir/include/mlir/Conversion/Passes.td
  mlir/include/mlir/InitAllPasses.h
  mlir/lib/Conversion/CMakeLists.txt
  mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
  mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt
  mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
  mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
  mlir/test/Conversion/StandardToLLVM/invalid.mlir
  mlir/test/Dialect/Linalg/llvm.mlir
  mlir/test/Dialect/Linalg/standard.mlir
  mlir/test/mlir-cpu-runner/linalg_integration_test.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79468.262286.patch
Type: text/x-patch
Size: 45004 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/1b6c9027/attachment.bin>


More information about the llvm-commits mailing list