[Mlir-commits] [mlir] [mlir][transform] Emit error message with `emitSilenceableFailure` (PR #86146)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Mar 22 03:59:31 PDT 2024


================
@@ -3269,22 +3269,24 @@ DiagnosedSilenceableFailure transform::FlattenElementwiseLinalgOp::applyToOne(
     transform::ApplyToEachResultList &results,
     transform::TransformState &state) {
   rewriter.setInsertionPoint(target);
-  if (!isElementwise(target)) {
-    failed(rewriter.notifyMatchFailure(
-        target, "only elementwise flattening is supported"));
-    return emitDefaultSilenceableFailure(target);
-  }
+  if (!isElementwise(target))
+    return mlir::emitSilenceableFailure(target->getLoc())
+           << "only elementwise flattening is supported";
+
   // If rank <= 1, do nothing
   if (target.getNumLoops() <= 1) {
     results.push_back(target);
     return DiagnosedSilenceableFailure::success();
   }
+
+  // Attempt to flatten all dims to one
----------------
ftynse wrote:

Nit: end comments with a period.

https://github.com/llvm/llvm-project/pull/86146


More information about the Mlir-commits mailing list