[Mlir-commits] [mlir] [mlir][ods] Verify access to operands in inferReturnTypes (PR #112574)
Mehdi Amini
llvmlistbot at llvm.org
Wed Oct 16 16:10:37 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());
----------------
joker-eph wrote:
I see it declared as ` OperandOrAttribute getArgToOperandOrAttribute(int index) const;` ?
https://github.com/llvm/llvm-project/pull/112574
More information about the Mlir-commits
mailing list