Skip to content

dialects: (py) an easy way to translate Python assignments #5676

@Fidget-Spinner

Description

@Fidget-Spinner

@superlopuh and I had a whiteboarding session last week where we discussed an easy way to translate Python source assignment semantics to MLIR, we've decided on using the symref dialect.

Problem: Python assignments do not follow SSA form, MLIR does.

Solution: map all assignments to symref, and appropiate fetch/update for assignment and load respectively. For symref.declare, this requires a little trick not so well known in Python land: function-scoped locals are actually pre-determined at Python bytecode compilation time, so we can use that to declare all known variables at the start of the function first.

I'm going to work on this soon.

Metadata

Metadata

Labels

dialectsChanges on the dialects

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions