[Mlir-commits] [mlir] [mlir][ods] Verfify access to operands in inferReturnTypes (PR #112574)
weiwei chen
llvmlistbot at llvm.org
Wed Oct 16 13:21:14 PDT 2024
================
@@ -3583,6 +3583,22 @@ 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;
+ auto arg = op.getArgToOperandOrAttribute(infer.getIndex());
+ if (arg.kind() == Operator::OperandOrAttribute::Kind::Operand)
+ maxAccessedIndex =
----------------
weiweichen wrote:
[nit] add `{}` here since formatting has two lines
https://github.com/llvm/llvm-project/pull/112574
More information about the Mlir-commits
mailing list