[Mlir-commits] [mlir] ff616a1 - [mlir][linalg]-Fix wrong assertion in the getMatchingYieldValue inter… (#89590)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Aug 7 08:34:15 PDT 2025


Author: Amir Bishara
Date: 2025-08-07T18:34:12+03:00
New Revision: ff616a192bb486915200675d7be33dc042deca24

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

LOG: [mlir][linalg]-Fix wrong assertion in the getMatchingYieldValue inter… (#89590)

…face

In order to have a consistent implementation for getMatchingYieldValue
for linalg generic with buffer/tensor semantics, we should assert the
opOperand index based on the numDpsInits and not numOfResults which may
be zero in the buffer semantics.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
index ba73cfbbed845..9f1e88a040f5f 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -474,7 +474,7 @@ def LinalgStructuredInterface
         int64_t resultIndex =
             opOperand->getOperandNumber() - $_op.getNumDpsInputs();
         assert(resultIndex >= 0 &&
-               resultIndex < this->getOperation()->getNumResults());
+               resultIndex < $_op.getNumDpsInits());
         Operation *yieldOp = getBlock()->getTerminator();
         return &yieldOp->getOpOperand(resultIndex);
       }]


        


More information about the Mlir-commits mailing list