Skip to content

Commit ba6774f

Browse files
authored
[mlir][xegpu] Fix verifier diagnostic recursion (#124148)
Uses global diagnostic message in operation verifier to avoid infinite recursion on a warning. Emitting diagnostics through the operation under verification creates a loop where verifier runs again before printing the message.
1 parent a976036 commit ba6774f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ LogicalResult LoadNdOp::verify() {
294294
if (valid)
295295
transpose(trans, tdescShape);
296296
else
297-
emitWarning("Invalid transpose attr. It is ignored.");
297+
mlir::emitWarning(getLoc()) << "Invalid transpose attr. It is ignored.";
298298
}
299299

300300
if (getPacked()) {
@@ -304,8 +304,9 @@ LogicalResult LoadNdOp::verify() {
304304
tdescShape[axis] /= vnni_factor;
305305
tdescShape.push_back(vnni_factor);
306306
} else {
307-
emitWarning("Invalid Packed Attr. It is ignored (available for 2D "
308-
"TensorDesc only).");
307+
mlir::emitWarning(getLoc())
308+
<< "Invalid Packed Attr. It is ignored (available for 2D "
309+
"TensorDesc only).";
309310
}
310311
}
311312

0 commit comments

Comments
 (0)