bloqade.lanes.utils.raise_if_statements_outside_dialect_group
← Module overview
function
source
functionraise_if_statements_outside_dialect_group¶source
bloqade.lanes.utils.raise_if_statements_outside_dialect_group
Signature
def raise_if_statements_outside_dialect_group(method: ir.Method, stage: str, hint: str | None = None) -> NoneRaise if method contains statements outside its own dialect group.
Thin wrapper around statements_outside_dialect_group that turns the offending statements into a single, precise error naming the statement kinds involved.
Call it at the end of a lowering stage under no_raise=False, alongside
verify(). It serves two purposes there:
- a real guard for a stage that drops a source dialect via
dialects.discard(...)and so must leave none of its statements behind —NativeToPlace*,MoveToSquin*,MoveToStackMove; - a cheap invariant for a stage that discards nothing, such as
PlaceToMove, which only adds themovedialect.
The composite PhysicalPipeline/LogicalPipeline entry points do not
call it themselves — they inherit the checks from the stages they compose.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
method | ir.Method | required | The kernel to scan. |
stage | str | required | Name of the stage that produced ``method``, used in the message. |
hint | str | None | None | Optional extra clause appended to the message, e.g. naming the rewrite rule that was expected to lower the statements. |
Raises
| Type | Description |
|---|---|
ValueError | If any statement's dialect is not a member of ``method.dialects``. |