Skip to content

Conversation

@tmarzec
Copy link

@tmarzec tmarzec commented Dec 25, 2025

This PR contains an implementation for MLIR codegen using the new sdql dialect in scair (see edin-dal/scair#391).

How to emit the MLIR code

Usage: run to_mlir <path> <sdql_file>
Example: run to_mlir progs/tpch q6.sdql

TPC-H coverage

Codegen succeeds for 19/22 queries. Current failures: q4, q15, and q22.

MLIR code for queries can be generated using gen_tpch_mlir.sh
Example: ./gen_tpch_mlir.sh /tmp/tpch-queries-mlir

Known limitations

  • Untyped empty dicts can break codegen when their type must be inferred. A fix is partially implemented (passing an “expected type” through function calls), but some edge cases remain.
  • Some language features are not yet supported (e.g., Load.skipCols, DictNode.hint).
  • The date type is lowered to i32. It should be investigated how it should be represented in MLIR.
  • Local SSA/value name collisions can occur with certain bound variable names.

@tmarzec tmarzec marked this pull request as ready for review December 27, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant