[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
Thu Aug 29 07:31:28 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)
+
+ with Context() as ctx, Location.unknown():
+ ctx.allow_unregistered_dialects = True
+ m = Module.create()
+ with InsertionPoint(m.body):
+ v = add_dummy_value()
+ ts = [IntegerType.get_signless(i * 8) for i in range(4)]
+
+ op = TestOpMultiResultSegments.build_generic(
+ results=[ts[0], ts[1], ts[2], ts[3]], operands=[v]
+ )
+ start, pg = equally_sized_accessor(op.results, 3, 1, 0)
----------------
kasper0406 wrote:
I used the naming from the generated code. My guess would be per group.
I'm happy to rename it, but maybe it's worth considering the generated code as well then.
https://github.com/llvm/llvm-project/pull/106003
More information about the Mlir-commits
mailing list