[Mlir-commits] [mlir] [mlir][ODS] Fix default inferReturnTypes generation for variadic operands (PR #131483)

Jacques Pienaar llvmlistbot at llvm.org
Mon Apr 21 06:53:02 PDT 2025


================
@@ -3751,29 +3750,15 @@ void OpEmitter::genTypeInterfaceMethods() {
   fctx.addSubst("_ctxt", "context");
   body << "  ::mlir::Builder odsBuilder(context);\n";
 
-  // Preprocessing stage to verify all accesses to operands are valid.
-  int maxAccessedIndex = -1;
-  for (int i = 0, e = op.getNumResults(); i != e; ++i) {
-    const InferredResultType &infer = op.getInferredResultType(i);
-    if (!infer.isArg())
-      continue;
-    Operator::OperandOrAttribute arg =
-        op.getArgToOperandOrAttribute(infer.getIndex());
-    if (arg.kind() == Operator::OperandOrAttribute::Kind::Operand) {
-      maxAccessedIndex =
-          std::max(maxAccessedIndex, arg.operandOrAttributeIndex());
-    }
-  }
-  if (maxAccessedIndex != -1) {
-    body << "  if (operands.size() <= " << Twine(maxAccessedIndex) << ")\n";
----------------
jpienaar wrote:

Is this check now handled in the adaptor? (I don't recall if there is a test for this upstream)

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


More information about the Mlir-commits mailing list