Skip to content

Commit 718e647

Browse files
authored
[mlir] Fix Wparentheses warning (#146893)
warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 265 | isa<VectorType>(operandType) && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 266 | "Unexpected non-vector ShapedType"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 parent 7b0f70a commit 718e647

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,8 @@ linalg::rewriteAsPaddedOp(RewriterBase &rewriter, TilingInterface opToPad,
261261
// 2.a. Skip scalar-like operands.
262262
Type operandType = operand.getType();
263263
if (!isa<RankedTensorType>(operandType)) {
264-
assert(!isa<ShapedType>(operandType) ||
265-
isa<VectorType>(operandType) &&
266-
"Unexpected non-vector ShapedType");
264+
assert((!isa<ShapedType>(operandType) || isa<VectorType>(operandType)) &&
265+
"Unexpected non-vector ShapedType");
267266
newOperands.push_back(operand);
268267
continue;
269268
}

mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,9 +1659,9 @@ createWriteOrMaskedWrite(OpBuilder &builder, Location loc, Value vecToStore,
16591659
}
16601660

16611661
// If missing, initialize the write indices to 0.
1662-
assert(writeIndices.empty() ||
1663-
writeIndices.size() == static_cast<size_t>(destRank) &&
1664-
"Invalid number of write indices!");
1662+
assert((writeIndices.empty() ||
1663+
writeIndices.size() == static_cast<size_t>(destRank)) &&
1664+
"Invalid number of write indices!");
16651665
if (writeIndices.empty()) {
16661666
auto zero = builder.create<arith::ConstantIndexOp>(loc, 0);
16671667
writeIndices.assign(destRank, zero);

mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ void CreateNdDescOp::build(OpBuilder &builder, OperationState &state,
135135
shape.size() == strides.size() && shape.size() == offsets.size());
136136

137137
Type srcTy = source.getType();
138-
assert(isa<IntegerType>(srcTy) ||
139-
isa<MemRefType>(srcTy) && "Source has to be either int or memref.");
138+
assert((isa<IntegerType, MemRefType>(srcTy)) &&
139+
"Source has to be either int or memref.");
140140

141141
llvm::SmallVector<Value> dynamicOffsets;
142142
llvm::SmallVector<Value> dynamicShape;

0 commit comments

Comments
 (0)