Skip to content

Commit 2a044f8

Browse files
authored
[MLIR] Add [[maybe_unused]] to variables on used in assert (#123037)
Add [[maybe_unused]] to suppresses warnings when `-NDEBUG` is enabled
1 parent 9bc8828 commit 2a044f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ using ExtractNBitsFn =
12911291
/// bitwise ops to avoid leaving LLVM to scramble with peephole optimizations.
12921292
static Value rewriteI4ToI8Ext(PatternRewriter &rewriter, Location loc,
12931293
Value srcValue, const ExtractNBitsFn &extFn) {
1294-
auto srcVecType = cast<VectorType>(srcValue.getType());
1294+
[[maybe_unused]] auto srcVecType = cast<VectorType>(srcValue.getType());
12951295
assert(srcVecType.getElementType().isSignlessInteger(4) &&
12961296
"Expected i4 type");
12971297

@@ -1311,7 +1311,7 @@ static Value rewriteI4ToI8Ext(PatternRewriter &rewriter, Location loc,
13111311
/// bitwise ops to avoid leaving LLVM to scramble with peephole optimizations.
13121312
static Value rewriteI2ToI8Ext(PatternRewriter &rewriter, Location loc,
13131313
Value srcValue, const ExtractNBitsFn &extFn) {
1314-
VectorType srcVecType = cast<VectorType>(srcValue.getType());
1314+
[[maybe_unused]] VectorType srcVecType = cast<VectorType>(srcValue.getType());
13151315
assert(srcVecType.getElementType().isSignlessInteger(2) &&
13161316
"Expected i2 type");
13171317

0 commit comments

Comments
 (0)