From: Uday Bondhugula Date: Fri, 27 Dec 2019 11:04:09 +0000 (+0100) Subject: [MLIR] [NFC] fix unused var warning X-Git-Tag: llvmorg-11-init~1326 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be775a003856fe65ce8dc05075192da65975806f;p=platform%2Fupstream%2Fllvm.git [MLIR] [NFC] fix unused var warning Summary: Fix this warning: ` [69/106] Building CXX object tools/mlir/lib/Dialect/StandardOps/CMakeFiles/MLIRStandardOps.dir/Ops.cpp.o /home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp: In member function ‘virtual mlir::PatternMatchResult {anonymous}::ViewOpShapeFolder::matchAndRewrite(mlir::ViewOp, mlir::PatternRewriter&) const’: /home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp:2575:14: warning: variable ‘dynamicOffsetOperandCount’ set but not used [-Wunused-but-set-variable] 2575 | unsigned dynamicOffsetOperandCount = 0; ` Reviewers: rriddle, mehdi_amini, ftynse Reviewed By: ftynse Subscribers: jpienaar, burmako, shauheen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71922 --- diff --git a/mlir/lib/Dialect/StandardOps/Ops.cpp b/mlir/lib/Dialect/StandardOps/Ops.cpp index f4b5e9a..b4fdcc4 100644 --- a/mlir/lib/Dialect/StandardOps/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/Ops.cpp @@ -2513,6 +2513,7 @@ struct ViewOpShapeFolder : public OpRewritePattern { auto newMemRefType = MemRefType::get(newShapeConstants, memrefType.getElementType(), {map}, memrefType.getMemorySpace()); + (void)dynamicOffsetOperandCount; // unused in opt mode assert(static_cast(newOperands.size()) == dynamicOffsetOperandCount + newMemRefType.getNumDynamicDims());