Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
newling committed Dec 10, 2024
1 parent b499df1 commit 2ffd51a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
9 changes: 3 additions & 6 deletions compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,16 +1348,13 @@ SmallVector<AMDAIE::NpuDmaCpyNdOp> NpuDmaWaitOp::getDmaOps() {
void TileOp::getAsmResultNames(function_ref<void(Value, StringRef)> setNameFn) {
std::optional<int64_t> iCol = getConstantIntValue(getCol());
std::optional<int64_t> iRow = getConstantIntValue(getRow());
std::string name{"tile"};
if (iCol.has_value() && iRow.has_value()) {
std::string sCol = std::to_string(iCol.value());
std::string sRow = std::to_string(iRow.value());
// std::string nameWithoutDialect =
// getOperationName().str().substr(getOperationName().find('.') + 1);
setNameFn(getResult(), "tile_" + sCol + "_" + sRow);
return;
name += "_" + sCol + "_" + sRow;
}

setNameFn(getResult(), "tile");
setNameFn(getResult(), name);
}

bool TileOp::hasStaticLocation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func.func @core() {
// -----

// CHECK-LABEL: func.func @logicalobjectfifo_from_memref
// CHECK: %[[I0:.*]] = amdaie.logicalobjectfifo.from_memref %[[ARG0:.*]], {}
// CHECK: %[[I0:.*]] = amdaie.logicalobjectfifo.from_memref %[[ARG0:.*]], {}
// CHECK-SAME: memref<1x1x8x16xi32, 1> -> !amdaie.logicalobjectfifo<memref<1x1x8x16xi32, 1>>
func.func @logicalobjectfifo_from_memref(%arg0: memref<1x1x8x16xi32, 1>) {
%0 = amdaie.logicalobjectfifo.from_memref %arg0, {} : memref<1x1x8x16xi32, 1> -> !amdaie.logicalobjectfifo<memref<1x1x8x16xi32, 1>>
Expand Down Expand Up @@ -487,3 +487,26 @@ func.func @reference_to() {
%1 = amdaie.reference_to %0 : memref<1x1x8x4x8x4xi32>
return
}

// -----

// Test that if the row and column are statically known, the tile operation is
// printed with the row and column in the SSA value.
func.func @tile_a_b(%i : index) {
%c2 = arith.constant 2: index
%c3 = arith.constant 3 : index
amdaie.workgroup {
// CHECK: %tile_2_3 = amdaie.tile
%t_23 = amdaie.tile(%c2, %c3)
// CHECK: %tile_2_3_0 = amdaie.tile
%t_231 = amdaie.tile(%c2, %c3)
// CHECK: %tile = amdaie.tile
%t_i3 = amdaie.tile(%i, %c3)
// CHECK: %tile_1 = amdaie.tile
%t_2i = amdaie.tile(%c2, %i)
amdaie.controlcode {
amdaie.end
}
}
return
}

0 comments on commit 2ffd51a

Please sign in to comment.