[Mlir-commits] [mlir] 8cc7189 - [mlir][Linalg][Transform] NFC - Replace assert by more graceful error

Nicolas Vasilache llvmlistbot at llvm.org
Tue Feb 21 06:15:48 PST 2023


Author: Nicolas Vasilache
Date: 2023-02-21T06:10:25-08:00
New Revision: 8cc718924341c3b0d8cede9e1b25755afd905dfe

URL: https://github.com/llvm/llvm-project/commit/8cc718924341c3b0d8cede9e1b25755afd905dfe
DIFF: https://github.com/llvm/llvm-project/commit/8cc718924341c3b0d8cede9e1b25755afd905dfe.diff

LOG: [mlir][Linalg][Transform] NFC - Replace assert by more graceful error

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
index 59ba8f84559e..aae073c28db8 100644
--- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
@@ -1323,8 +1323,8 @@ DenseSet<int64_t> transform::findPermutationsIndexingOperand(
 }
 
 FailureOr<GemmDimsForPacking> transform::inferGemmDims(LinalgOp linalgOp) {
-  assert(linalgOp.getNumDpsInits() == 1 && "wrong number of dps inits");
-  assert(linalgOp.getNumDpsInputs() == 2 && "wrong number of dps inputs");
+  if (linalgOp.getNumDpsInits() != 1 || linalgOp.getNumDpsInputs() != 2)
+    return failure();
 
   DenseSet<int64_t> a = findPermutationsIndexingOperand(
       linalgOp, linalgOp.getDpsInputOperand(0), par);


        


More information about the Mlir-commits mailing list