You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test InstCombine/win-fdim.ll does not round-trip via xdsl, due to what I believe is an issue with floating point hex literals such as fp128 0xL00000000000000000000000000000000.
Round-tripping fails with:
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/bug.py", line 82, in <module>
p.print(module)
~~~~~~~^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 134, in print
self.print_op(arg)
~~~~~~~~~~~~~^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 853, in print_op
op.print(self)
~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/dialects/builtin.py", line 1746, in print
printer.print(" ", self.body)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 127, in print
self.print_region(arg)
~~~~~~~~~~~~~~~~~^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 275, in print_region
self.print_block(
~~~~~~~~~~~~~~~~^
entry_block,
^^^^^^^^^^^^
print_block_args=print_entry_block_args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print_block_terminator=print_block_terminators,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 237, in print_block
self.print_op(op)
~~~~~~~~~~~~~^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 855, in print_op
self.print_op_with_default_format(op)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 745, in print_op_with_default_format
self.print_regions(op.regions)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 294, in print_regions
self.print_list(regions, self.print_region)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/utils/base_printer.py", line 67, in print_list
print_fn(elem)
~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 275, in print_region
self.print_block(
~~~~~~~~~~~~~~~~^
entry_block,
^^^^^^^^^^^^
print_block_args=print_entry_block_args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print_block_terminator=print_block_terminators,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 237, in print_block
self.print_op(op)
~~~~~~~~~~~~~^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 853, in print_op
op.print(self)
~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/dialects/llvm.py", line 1581, in print
if isattr(self.value, AnyIntegerAttr) and self.result.type == IntegerType(64):
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/utils/isattr.py", line 28, in isattr
return isa(arg, hint)
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/utils/hints.py", line 98, in isa
constraint.verify(arg, ConstraintContext())
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/irdl/constraints.py", line 580, in verify
f"{attr} should be of base attribute {self.base_attr.name}"
^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/ir/core.py", line 299, in __str__
printer.print_attribute(self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 432, in print_attribute
attribute.print_without_type(self)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/dialects/builtin.py", line 908, in print_without_type
return printer.print_float_attr(self)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 337, in print_float_attr
self.print_float(attribute.value.data, attribute.type)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/printer.py", line 357, in print_float
parsed_value = type.unpack(type.pack([float(float_str)]), 1)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/dialects/builtin.py", line 456, in pack
fmt = self.format[0] + str(len(values)) + self.format[1:]
^^^^^^^^^^^
File "/Users/bollu/25/michelmas/lean-mlir/SSA/Projects/InstCombine/scripts/venv/lib/python3.13/site-packages/xdsl/dialects/builtin.py", line 817, in format
raise NotImplementedError()
Steps to Reproduce and a Minimal Working Example (MWE)
Hi @bollu, thanks for this, but I cannot run the provided MWE (undefined stuff like ctx etc.) and also not all props/attributes are there in our implementation of llvm.func, so I'm not sure how your example circumvents all these errors and goes to the parsing error you provided.
Nevertheless, I think I've reduced the above to this:
Description
The test
InstCombine/win-fdim.ll
does not round-trip viaxdsl
, due to what I believe is an issue with floating point hex literals such asfp128 0xL00000000000000000000000000000000
.Round-tripping fails with:
Steps to Reproduce and a Minimal Working Example (MWE)
Additional Information
Any extra information that might help debug the issue.
The text was updated successfully, but these errors were encountered: