[Mlir-commits] [mlir] [mlir][python] Fix how the mlir variadic Python accessor `_ods_equally_sized_accessor` is used (#101132) (PR #106003)

Kasper Nielsen llvmlistbot at llvm.org
Fri Aug 30 04:02:59 PDT 2024


================
@@ -208,3 +209,70 @@ class TestOp(OpView):
 
 
 run(testOdsBuildDefaultCastError)
+
+
+def testOdsEquallySizedAccessor():
+    class TestOpMultiResultSegments(OpView):
+        OPERATION_NAME = "custom.test_op"
+        _ODS_REGIONS = (1, True)
----------------
kasper0406 wrote:

Very good call with the proposed extra test.
I've added it now, and in the process figured out that more information was needed in the `equally_sized_accessor` function.
I did a bit of refactoring in the `OpPythonBindingGen.cpp` file, so the `emitElementAccessors` does not need to take in as many function pointers.

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


More information about the Mlir-commits mailing list