[Mlir-commits] [mlir] [mlir][vector] Fix invalid `LoadOp` indices being created (PR #75519)

Rik Huijzer llvmlistbot at llvm.org
Sat Dec 16 10:07:11 PST 2023


================
@@ -1615,8 +1615,10 @@ GetGlobalOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
 //===----------------------------------------------------------------------===//
 
 LogicalResult LoadOp::verify() {
-  if (getNumOperands() != 1 + getMemRefType().getRank())
-    return emitOpError("incorrect number of indices for load");
+  if (getNumOperands() - 1 != getMemRefType().getRank()) {
+    return emitOpError("incorrect number of indices for load, expected ")
+           << getMemRefType().getRank() << " but got " << getNumOperands() - 1;
+  }
----------------
rikhuijzer wrote:

Thanks 👍 Nice suggestion!

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


More information about the Mlir-commits mailing list