MLIR-AIE
Utils.h
Go to the documentation of this file.
1//===- Utils.h - Utilities to support AIE vectorization ---------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7// (c) Copyright 2023, Advanced Micro Devices, Inc.
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef AIE_DIALECT_AIEVEC_UTILS_UTILS_H
12#define AIE_DIALECT_AIEVEC_UTILS_UTILS_H
13
14#include "mlir/Dialect/Vector/IR/VectorOps.h"
15#include <cstdint>
16#include <optional>
17#include <type_traits>
18
19namespace mlir {
20
21class AffineExpr;
22class AffineForOp;
23class AffineMap;
24class Operation;
25
26} // namespace mlir
27
28namespace xilinx::aievec {
29
30template <
31 typename TransferReadLikeOp,
32 typename = std::enable_if_t<
33 std::is_same_v<TransferReadLikeOp, mlir::vector::TransferReadOp> ||
34 std::is_same_v<TransferReadLikeOp,
35 mlir::vector::TransferReadOp::Adaptor>>>
36std::optional<int64_t> getTransferReadAlignmentOffset(TransferReadLikeOp readOp,
37 mlir::VectorType vType,
38 int64_t alignment);
39
40mlir::VectorType getFlattenedVectorType(mlir::VectorType vecTy);
41
42} // namespace xilinx::aievec
43
44#endif // AIE_DIALECT_AIEVEC_UTILS_UTILS_H
mlir::VectorType getFlattenedVectorType(mlir::VectorType vecTy)
std::optional< int64_t > getTransferReadAlignmentOffset(TransferReadLikeOp readOp, mlir::VectorType vType, int64_t alignment)