[Mlir-commits] [mlir] ba6774f - [mlir][xegpu] Fix verifier diagnostic recursion (#124148)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jan 24 09:09:53 PST 2025
Author: Adam Siemieniuk
Date: 2025-01-24T18:09:48+01:00
New Revision: ba6774f997ee28157b0a3b8816cc76b94ed1da17
URL: https://github.com/llvm/llvm-project/commit/ba6774f997ee28157b0a3b8816cc76b94ed1da17
DIFF: https://github.com/llvm/llvm-project/commit/ba6774f997ee28157b0a3b8816cc76b94ed1da17.diff
LOG: [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.
Added:
Modified:
mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
index 15c435f1fa257b..81f46f941785a1 100644
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
@@ -294,7 +294,7 @@ LogicalResult LoadNdOp::verify() {
if (valid)
transpose(trans, tdescShape);
else
- emitWarning("Invalid transpose attr. It is ignored.");
+ mlir::emitWarning(getLoc()) << "Invalid transpose attr. It is ignored.";
}
if (getPacked()) {
@@ -304,8 +304,9 @@ LogicalResult LoadNdOp::verify() {
tdescShape[axis] /= vnni_factor;
tdescShape.push_back(vnni_factor);
} else {
- emitWarning("Invalid Packed Attr. It is ignored (available for 2D "
- "TensorDesc only).");
+ mlir::emitWarning(getLoc())
+ << "Invalid Packed Attr. It is ignored (available for 2D "
+ "TensorDesc only).";
}
}
More information about the Mlir-commits
mailing list