Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: relax some types in range variable solving #3317

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions xdsl/irdl/declarative_assembly_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,24 @@ def parse(
# Infer operand types that should be inferred
unresolved_operands = state.operands
assert isa(
unresolved_operands, list[UnresolvedOperand | list[UnresolvedOperand]]
unresolved_operands,
Sequence[UnresolvedOperand | Sequence[UnresolvedOperand]],
), unresolved_operands
self.resolve_operand_types(state, op_def)
operand_types = state.operand_types
assert isa(operand_types, list[Attribute | list[Attribute]])
assert isa(operand_types, Sequence[Attribute | Sequence[Attribute]])

# Infer result types that should be inferred
self.resolve_result_types(state, op_def)
result_types = state.result_types
assert isa(result_types, list[Attribute | list[Attribute]])
assert isa(result_types, Sequence[Attribute | Sequence[Attribute]])

# Resolve all operands
operands: Sequence[SSAValue | Sequence[SSAValue]] = []
for uo, ot in zip(unresolved_operands, operand_types, strict=True):
if isinstance(uo, list):
if isinstance(uo, Sequence):
assert isinstance(
ot, list
ot, Sequence
), "Something went wrong with the declarative assembly format parser."
"Variadic or optional operand has no type or a single type "
operands.append(parser.resolve_operands(uo, ot, parser.pos))
Expand Down
Loading