[Mlir-commits] [mlir] [mlir][tensor] Check the EmptyOp's dynamicSize to be non-negative (PR #65577)

Mehdi Amini llvmlistbot at llvm.org
Thu Sep 7 16:15:34 PDT 2023


================
@@ -621,6 +621,18 @@ LogicalResult EmptyOp::verify() {
     return emitOpError("incorrect number of dynamic sizes, has ")
            << getDynamicSizes().size() << ", expected "
            << getType().getNumDynamicDims();
+
+  if (getDynamicSizes().size() > 0) {
+    if (llvm::any_of(getDynamicSizes(), [](Value operand) {
+          APInt constSizeArg;
+          if (!matchPattern(operand, m_ConstantInt(&constSizeArg))) {
----------------
joker-eph wrote:

This does not belong to the verifier, because: https://mlir.llvm.org/getting_started/DeveloperGuide/#ir-verifier

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


More information about the Mlir-commits mailing list