Skip to content

Commit

Permalink
Fixup format for iree; remove unused variables (Xilinx#423)
Browse files Browse the repository at this point in the history
* Fixup format for iree; remove unused variables

* Clang-format
  • Loading branch information
erwei-xilinx authored Feb 13, 2024
1 parent 43786ba commit 59d80b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/AIRRtToIpuPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions mlir/lib/Conversion/AIRToAIEPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,14 +1212,9 @@ struct LowerAIRChannelsPattern : public OpRewritePattern<air::ChannelOp> {
// 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();
}

Expand Down
6 changes: 0 additions & 6 deletions mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,6 @@ struct HoistAIRChannelInAccumPattern : public OpRewritePattern<scf::ForOp> {
air::ChannelPutOp op_2) const {
bool areSymmetric = op_1.getMemref() == op_2.getMemref();
// Check offsets, sizes and strides
auto op_1_dmaNd = dyn_cast<air::DmaMemcpyNdOp>(op_1.getOperation());
auto op_2_dmaNd = dyn_cast<air::DmaMemcpyNdOp>(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();
Expand Down Expand Up @@ -528,13 +526,9 @@ struct HoistAIRChannelInAccumPattern : public OpRewritePattern<scf::ForOp> {
}
}
Operation *actual_op_1 = op_1;
Operation *actual_op_2 = op_2;
if (auto exec = dyn_cast<air::ExecuteOp>(op_1)) {
actual_op_1 = exec.getChildOp();
}
if (auto exec = dyn_cast<air::ExecuteOp>(op_2)) {
actual_op_2 = exec.getChildOp();
}
Value op_1_memref = nullptr;
Value op_2_memref = nullptr;
if (auto linalg_op = dyn_cast<linalg::LinalgOp>(actual_op_1)) {
Expand Down

0 comments on commit 59d80b2

Please sign in to comment.