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
35 lines
889 B
C++
35 lines
889 B
C++
//===- PassDetail.h - Transforms Pass class details -------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef TRANSFORMS_PASSDETAIL_H_
|
|
#define TRANSFORMS_PASSDETAIL_H_
|
|
|
|
#include "mlir/Pass/Pass.h"
|
|
|
|
namespace mlir {
|
|
class AffineDialect;
|
|
|
|
// Forward declaration from Dialect.h
|
|
template <typename ConcreteDialect>
|
|
void registerDialect(DialectRegistry ®istry);
|
|
|
|
namespace linalg {
|
|
class LinalgDialect;
|
|
} // end namespace linalg
|
|
|
|
namespace memref {
|
|
class MemRefDialect;
|
|
} // end namespace memref
|
|
|
|
#define GEN_PASS_CLASSES
|
|
#include "mlir/Transforms/Passes.h.inc"
|
|
|
|
} // end namespace mlir
|
|
|
|
#endif // TRANSFORMS_PASSDETAIL_H_
|