From 59d80b2b91e45d55637576ab7931d4e012950bb3 Mon Sep 17 00:00:00 2001 From: erwei-xilinx Date: Tue, 13 Feb 2024 12:56:44 -0800 Subject: [PATCH] Fixup format for iree; remove unused variables (#423) * Fixup format for iree; remove unused variables * Clang-format --- mlir/lib/Conversion/AIRRtToIpuPass.cpp | 2 +- mlir/lib/Conversion/AIRToAIEPass.cpp | 9 ++------- mlir/lib/Transform/AIRDependencyScheduleOpt.cpp | 6 ------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/mlir/lib/Conversion/AIRRtToIpuPass.cpp b/mlir/lib/Conversion/AIRRtToIpuPass.cpp index 2d20b8337..51569fba8 100644 --- a/mlir/lib/Conversion/AIRRtToIpuPass.cpp +++ b/mlir/lib/Conversion/AIRRtToIpuPass.cpp @@ -520,7 +520,7 @@ specializeAffineForInAIRRtDmaWrapAndStride(OpBuilder builder, strides.push_back(i64_one); // Canonicalize wraps and strides - air::canonicalizeWrapAndStrideList(builder, offsets, wraps, strides); + (void)air::canonicalizeWrapAndStrideList(builder, offsets, wraps, strides); xilinx::air::foldForLoopNestAsExtendedSizesAndStrides( builder, for_op.getOperation(), memcpy_ops[0].getOperation(), offsets, diff --git a/mlir/lib/Conversion/AIRToAIEPass.cpp b/mlir/lib/Conversion/AIRToAIEPass.cpp index 96f668a99..60c9936b4 100644 --- a/mlir/lib/Conversion/AIRToAIEPass.cpp +++ b/mlir/lib/Conversion/AIRToAIEPass.cpp @@ -1212,14 +1212,9 @@ struct LowerAIRChannelsPattern : public OpRewritePattern { // erase the channel rewriter.eraseOp(channel); // erase dangling allocs - for (auto o : erased_allocs) { - int num_users = 0; - for (auto u : o->getUsers()) - num_users++; - // erase only when all related channels have been erased - if (num_users == 0) + for (auto o : erased_allocs) + if (o->use_empty()) rewriter.eraseOp(o); - } return success(); } diff --git a/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp b/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp index aa9b19caa..b8c4b1431 100644 --- a/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp +++ b/mlir/lib/Transform/AIRDependencyScheduleOpt.cpp @@ -498,8 +498,6 @@ struct HoistAIRChannelInAccumPattern : public OpRewritePattern { air::ChannelPutOp op_2) const { bool areSymmetric = op_1.getMemref() == op_2.getMemref(); // Check offsets, sizes and strides - auto op_1_dmaNd = dyn_cast(op_1.getOperation()); - auto op_2_dmaNd = dyn_cast(op_2.getOperation()); unsigned op_1_dst_num_entries = op_1.getOffsets().size(); unsigned op_1_src_num_entries = op_1.getOffsets().size(); unsigned op_2_dst_num_entries = op_2.getOffsets().size(); @@ -528,13 +526,9 @@ struct HoistAIRChannelInAccumPattern : public OpRewritePattern { } } Operation *actual_op_1 = op_1; - Operation *actual_op_2 = op_2; if (auto exec = dyn_cast(op_1)) { actual_op_1 = exec.getChildOp(); } - if (auto exec = dyn_cast(op_2)) { - actual_op_2 = exec.getChildOp(); - } Value op_1_memref = nullptr; Value op_2_memref = nullptr; if (auto linalg_op = dyn_cast(actual_op_1)) {