Skip to content

bloqade.lanes.utils.statements_outside_dialect_group

← Module overview

functionstatements_outside_dialect_groupsource

bloqade.lanes.utils.statements_outside_dialect_group

Signature
def statements_outside_dialect_group(method: ir.Method) -> list[ir.Statement]

Return every statement in method whose dialect is not in its group.

Kirin’s Method.verify() checks per-statement structure but never validates that each statement’s dialect is a member of the method’s declared DialectGroup. An out-of-group statement therefore passes verify() cleanly and only surfaces lazily — as an InterpreterError at interpretation/emit time (see kirin.interp.abc), far from its cause.

Use this after a lowering pass that is expected to leave no statements from the source dialect behind (e.g. move after RewriteMoveToStackMove) to fail fast with a precise, local error instead.

Statements with no dialect (stmt.dialect is None, e.g. dialect-agnostic base statements) are ignored.

Parameters

NameTypeDescription
methodir.MethodThe kernel to scan.

Returns

(list[ir.Statement], list[ir.Statement])The offending statements, in walk order. Empty if every statement's dialect is a member of ``method.dialects``.

source