[Mlir-commits] [mlir] Allow empty dimension arrays in `linalg::inferContractionDims` (PR #69496)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 18 11:43:36 PDT 2023


https://github.com/bjacob updated https://github.com/llvm/llvm-project/pull/69496

>From 835049da083d930b436a7624349aec01c6af2c9a Mon Sep 17 00:00:00 2001
From: Benoit Jacob <jacob.benoit.1 at gmail.com>
Date: Wed, 18 Oct 2023 14:36:14 -0400
Subject: [PATCH] allow-empty

---
 mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
index ea50e1232a4c74a..5fde8d71cac3e75 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
@@ -227,9 +227,6 @@ mlir::linalg::inferContractionDims(LinalgOp linalgOp) {
       linalgOp, linalgOp.getDpsInputOperand(1), red);
   llvm::set_intersect(ra, rb);
 
-  if (ac.empty() || bc.empty() || ra.empty())
-    return failure();
-
   // Return each set in sorted order.
   ContractionDimensions dimensions{
       SmallVector<unsigned, 2>(batches.begin(), batches.end()),



More information about the Mlir-commits mailing list