MLIR-AIE
AIEUtils.h
Go to the documentation of this file.
1//===- AIEUtils.h -----------------------------------------------*- C++ -*-===//
2//
3// This file is licensed 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 2025 Advanced Micro Devices, Inc.
8//
9//===----------------------------------------------------------------------===//
10
12#include "mlir/Dialect/MemRef/IR/MemRef.h"
13#include "mlir/IR/Value.h"
14
15using namespace mlir;
16
17namespace xilinx {
18namespace AIEX {
19
20memref::GlobalOp getOrCreateDataMemref(OpBuilder &builder, AIE::DeviceOp dev,
21 mlir::Location loc,
22 ArrayRef<uint32_t> words);
23
24// Result of tracing through subview/cast operations to a block argument for
25// traceSubviewToBlockArgument function.
27 BlockArgument rootArg;
29};
30
31// Trace through memref.subview, memref.cast, and memref.reinterpret_cast
32// operations until the referenced SSA value is a block argument.
33//
34// Returns the root block argument and cumulative byte offset, or std::nullopt
35// if the chain doesn't lead to a block argument or contains unsupported ops.
36//
37// This function checks that all subviews remain static and contiguous.
38std::optional<SubviewTraceResult> traceSubviewToBlockArgument(Value value);
39}
40} // namespace xilinx
std::optional< SubviewTraceResult > traceSubviewToBlockArgument(Value value)
Definition AIEUtils.cpp:19
memref::GlobalOp getOrCreateDataMemref(OpBuilder &builder, AIE::DeviceOp dev, mlir::Location loc, ArrayRef< uint32_t > words)
Definition AIEUtils.cpp:113