diff --git a/include/aie/Dialect/AIE/IR/AIEOps.td b/include/aie/Dialect/AIE/IR/AIEOps.td index 627eb362cc..f57f3fb10d 100644 --- a/include/aie/Dialect/AIE/IR/AIEOps.td +++ b/include/aie/Dialect/AIE/IR/AIEOps.td @@ -67,6 +67,7 @@ def AIE_DeviceOp: AIE_Op<"device", [ } def AIE_TileOp: AIE_Op<"tile", [ + Pure, FlowEndPoint, DeclareOpInterfaceMethods, DeclareOpInterfaceMethods diff --git a/test/dialect/AIE/tileop_cse.mlir b/test/dialect/AIE/tileop_cse.mlir new file mode 100644 index 0000000000..bda8255c8b --- /dev/null +++ b/test/dialect/AIE/tileop_cse.mlir @@ -0,0 +1,26 @@ +//===- tileop_cse.mlir -----------------------------------------*- MLIR -*-===// +// +// This file is licensed 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 +// +// Copyright (C) 2024, Advanced Micro Devices, Inc. +// +//===----------------------------------------------------------------------===// + +// RUN: aie-opt --split-input-file --pass-pipeline="builtin.module(cse)" %s | FileCheck %s + +// CHECK: %[[TILE1:.*]] = aie.tile(1, 1) +// CHECK-NOT: %[[TILE2:.*]] = aie.tile(1, 1) +// CHECK: %[[CORE1:.*]] = aie.core(%[[TILE1]]) +// CHECK: %[[CORE2:.*]] = aie.core(%[[TILE1]]) +module { + %tile_1 = aie.tile(1, 1) + %tile_2 = aie.tile(1, 1) + %core_1 = aie.core(%tile_1) { + aie.end + } + %core_2 = aie.core(%tile_2) { + aie.end + } +}