Skip to content

Commit

Permalink
[AIE] Add Pure trait to TileOp (#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtuyls authored Apr 19, 2024
1 parent 9dbd283 commit d065e66
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/aie/Dialect/AIE/IR/AIEOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def AIE_DeviceOp: AIE_Op<"device", [
}

def AIE_TileOp: AIE_Op<"tile", [
Pure,
FlowEndPoint,
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
DeclareOpInterfaceMethods<InferTypeOpInterface>
Expand Down
26 changes: 26 additions & 0 deletions test/dialect/AIE/tileop_cse.mlir
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit d065e66

Please sign in to comment.