[PATCH] D71922: [MLIR] [NFC] fix unused var warning

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 02:23:02 PST 2019


bondhugula created this revision.
bondhugula added reviewers: rriddle, mehdi_amini.
Herald added subscribers: llvm-commits, shauheen, burmako, jpienaar.
Herald added a project: LLVM.

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;
`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71922

Files:
  mlir/lib/Dialect/StandardOps/Ops.cpp


Index: mlir/lib/Dialect/StandardOps/Ops.cpp
===================================================================
--- mlir/lib/Dialect/StandardOps/Ops.cpp
+++ mlir/lib/Dialect/StandardOps/Ops.cpp
@@ -2513,6 +2513,7 @@
     auto newMemRefType =
         MemRefType::get(newShapeConstants, memrefType.getElementType(), {map},
                         memrefType.getMemorySpace());
+    (void)dynamicOffsetOperandCount; // unused in opt mode
     assert(static_cast<int64_t>(newOperands.size()) ==
            dynamicOffsetOperandCount + newMemRefType.getNumDynamicDims());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71922.235400.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191227/ac7103d6/attachment.bin>


More information about the llvm-commits mailing list