[all-commits] [llvm/llvm-project] 000a05: [mlir] Normalize dynamic memrefs with a map of til...

Haruki Imai via All-commits all-commits at lists.llvm.org
Sun May 23 20:12:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 000a05fd1ab33329f7ef2dd85a3f027a7d0c3a4b
      https://github.com/llvm/llvm-project/commit/000a05fd1ab33329f7ef2dd85a3f027a7d0c3a4b
  Author: Haruki Imai <imaihal at jp.ibm.com>
  Date:   2021-05-24 (Mon, 24 May 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/PassDetail.h
    M mlir/lib/Transforms/Utils/Utils.cpp
    A mlir/test/Transforms/normalize-memrefs-ops-dynamic.mlir

  Log Message:
  -----------
  [mlir] Normalize dynamic memrefs with a map of tiled-layout.

Steps for normalizing dynamic memrefs for tiled layout map
1. Check if original map is tiled layout. Only tiled layout is supported.
2. Create normalized memrefType. Dimensions that include dynamic dimensions
   in the map output will be dynamic dimensions.
3. Create new maps to calculate each dimension size of new memref.
   In tiled layout, the dimension size can be calculated by replacing
    "floordiv <tile size>" with "ceildiv <tile size>" and
    "mod <tile size>" with "<tile size>".
4. Create AffineApplyOp to apply the new maps. The output of AffineApplyOp is
   dynamicSizes for new AllocOp.
5. Add the new dynamic sizes in new AllocOp.

This patch also set MemRefsNormalizable trant in CastOp and DimOp since
they used with dynamic memrefs.

Reviewed By: bondhugula

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




More information about the All-commits mailing list