Skip to content

Commit

Permalink
Fix unused errors in build without assertions (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtuyls authored Jan 21, 2025
1 parent aec2938 commit d226668
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/AIRLoweringPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ AIRChannelInterfaceToAIRRtConversionImpl(OpBuilder builder,
strides.push_back(one_idx);
}
// Stride field implicit last element one
auto lastStrideConst = getConstantIntValue(strides.back());
[[maybe_unused]] auto lastStrideConst = getConstantIntValue(strides.back());
assert(lastStrideConst && "the last stride is not static");

strides.pop_back();
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Transform/AIRDependencyScheduleOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ struct UnrollScfParallel : public OpRewritePattern<scf::ParallelOp> {
auto loc = rewriter.getUnknownLoc();

for (auto lb : par.getLowerBound()) {
auto constLB = getConstantIntValue(lb);
[[maybe_unused]] auto constLB = getConstantIntValue(lb);
assert(constLB && "non-static scf.parallel lb, NYI");
assert(*constLB == 0 && "non-zero scf.parallel lb, NYI");
}
Expand Down Expand Up @@ -3802,7 +3802,7 @@ class AIRFuseChannels
return notMergeable;
}
// Merge by unpeeling into UB.
auto outerMostScfFor =
[[maybe_unused]] auto outerMostScfFor =
dyn_cast<scf::ForOp>(a_loop_nest[outermostScfFor]->getParentOp());
assert(outerMostScfFor);
return mergeableToUB;
Expand Down
8 changes: 4 additions & 4 deletions mlir/lib/Util/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,8 @@ air::writeAccessPattern(mlir::vector::TransferReadOp readOp) {
OpBuilder builder(readOp);
std::tuple<SmallVector<Value>, SmallVector<Value>, SmallVector<Value>>
pattern;
auto vectorTy = llvm::cast<VectorType>(readOp.getVector().getType());
auto memrefTy = llvm::cast<MemRefType>(readOp.getSource().getType());
[[maybe_unused]] auto vectorTy = llvm::cast<VectorType>(readOp.getVector().getType());
[[maybe_unused]] auto memrefTy = llvm::cast<MemRefType>(readOp.getSource().getType());
assert(vectorTy && "Not a vector");
assert(memrefTy && "Not a memref");
// Initialize wraps and strides based on the unshrunk memref shape.
Expand All @@ -1400,8 +1400,8 @@ air::writeAccessPattern(mlir::vector::TransferWriteOp writeOp) {
OpBuilder builder(writeOp);
std::tuple<SmallVector<Value>, SmallVector<Value>, SmallVector<Value>>
pattern;
auto memrefTy = llvm::cast<MemRefType>(writeOp.getSource().getType());
auto vectorTy = llvm::cast<VectorType>(writeOp.getVector().getType());
[[maybe_unused]] auto memrefTy = llvm::cast<MemRefType>(writeOp.getSource().getType());
[[maybe_unused]] auto vectorTy = llvm::cast<VectorType>(writeOp.getVector().getType());
assert(memrefTy && "Not a memref");
assert(vectorTy && "Not a vector");
// Initialize wraps and strides based on the unshrunk memref shape.
Expand Down

0 comments on commit d226668

Please sign in to comment.