Skip to content

CFG

CFG dataclass

CFG(parent: ir.Region, entry: ir.Block | None = None)

Bases: Printable

Control Flow Graph of a given IR statement.

This class implements the kirin.graph.Graph protocol.

Pretty Printing

This object is pretty printable via .print() method.

entry class-attribute instance-attribute

entry: Block | None = None

Entry block of the CFG.

parent instance-attribute

parent: Region

Parent IR statement.

predecessors cached property

predecessors

CFG data, mapping a block to its predecessors.

successors cached property

successors

CFG data, mapping a block to its neighbors.