[all-commits] [llvm/llvm-project] f1b972: [mlir][Linalg] Start a LinalgToStandard pass and m...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Thu May 14 21:35:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f1b972041adf565c08d1abca41068d2adcf62702
      https://github.com/llvm/llvm-project/commit/f1b972041adf565c08d1abca41068d2adcf62702
  Author: Nicolas Vasilache <ntv at google.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    A mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
    M mlir/include/mlir/Conversion/Passes.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/IR/StandardTypes.h
    M mlir/include/mlir/InitAllPasses.h
    M mlir/lib/Conversion/CMakeLists.txt
    M mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
    A mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt
    A mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/IR/StandardTypes.cpp
    M mlir/test/Conversion/StandardToLLVM/invalid.mlir
    M mlir/test/Dialect/Linalg/llvm.mlir
    A mlir/test/Dialect/Linalg/standard.mlir
    M mlir/test/mlir-cpu-runner/linalg_integration_test.mlir

  Log Message:
  -----------
  [mlir][Linalg] Start a LinalgToStandard pass and move conversion to library calls.

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.

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




More information about the All-commits mailing list