Skip to content

bloqade.rewrite.rules.split_ifs.LiftThenBody

← Module overview

classLiftThenBodysource

bloqade.rewrite.rules.split_ifs.LiftThenBody

Bases: RewriteRule

Lifts anything that's not in the `exclude_stmts` in the *then* body

Signature
class LiftThenBody(exclude_stmts: tuple[type[ir.Statement], ...] = tuple())

Parameters

NameTypeDefaultDescription
exclude_stmtstuple[type[ir.Statement], ...]tuple()A tuple of statement types that should not be lifted from the then body. Defaults to an empty tuple, meaning all statements are lifted.

Attributes

NameTypeDefaultDescription
exclude_stmtstuple[type[ir.Statement], ...]field(default_factory=tuple)

methodrewrite_Statementsource

bloqade.rewrite.rules.split_ifs.LiftThenBody.rewrite_Statement

def rewrite_Statement(node: ir.Statement) -> RewriteResult

Parameters

NameTypeDescription
nodeir.Statement

Returns

RewriteResult

source