[Mlir-commits] [mlir] [mlir][ods] Verfify access to operands in inferReturnTypes (PR #112574)
weiwei chen
llvmlistbot at llvm.org
Wed Oct 16 13:21:15 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());
----------------
weiweichen wrote:
spell `auto` here please
https://github.com/llvm/llvm-project/pull/112574
More information about the Mlir-commits
mailing list