[all-commits] [llvm/llvm-project] 793ee2: [mlir][gpu] Add DecomposeMemrefsPass

Ivan Butygin via All-commits all-commits at lists.llvm.org
Thu Aug 10 13:31:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 793ee2bf08680e221018f5707aca6eab121d1a41
      https://github.com/llvm/llvm-project/commit/793ee2bf08680e221018f5707aca6eab121d1a41
  Author: Ivan Butygin <ivan.butygin at gmail.com>
  Date:   2023-08-10 (Thu, 10 Aug 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/GPU/Transforms/Passes.h
    M mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
    M mlir/include/mlir/Dialect/Utils/IndexingUtils.h
    M mlir/lib/Dialect/GPU/CMakeLists.txt
    A mlir/lib/Dialect/GPU/Transforms/DecomposeMemrefs.cpp
    M mlir/lib/Dialect/Utils/IndexingUtils.cpp
    A mlir/test/Dialect/GPU/decompose-memrefs.mlir

  Log Message:
  -----------
  [mlir][gpu] Add DecomposeMemrefsPass

Some GPU backends (SPIR-V) lower memrefs to bare pointers, so for dynamically sized/strided memrefs it will fail.
This pass extracts sizes and strides via `memref.extract_strrided_metadata` outside `gpu.launch` body and do index/offset calculation explicitly and then reconstructs memrefs via `memref.reinterpret_cast`.

`memref.reinterpret_cast` then lowered via https://reviews.llvm.org/D155011

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




More information about the All-commits mailing list