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