SSA values
BlockArgument dataclass
BlockArgument(
block: Block,
index: int,
type: TypeAttribute = AnyType(),
)
Bases: SSAValue
SSAValue that is an argument to a Block.
Source code in src/kirin/ir/ssa.py
157 158 159 160 161 162 163 | |
block class-attribute instance-attribute
block: Block = block
The block that this argument belongs to.
index class-attribute instance-attribute
index: int = index
The index of this argument in the block's argument list.
owner property
owner: Block
The object that owns this SSA value.
type instance-attribute
type = type
The type of this SSA value.
delete
delete(safe: bool = True) -> None
Delete this SSA value. If safe is True, raise an error if there are uses.
Source code in src/kirin/ir/ssa.py
169 170 | |
DeletedSSAValue dataclass
DeletedSSAValue(value: SSAValue)
Bases: SSAValue
Source code in src/kirin/ir/ssa.py
201 202 203 204 | |
owner property
owner: Statement | Block
The object that owns this SSA value.
type instance-attribute
type = type
The type of this SSA value.
ResultValue dataclass
ResultValue(
stmt: Statement,
index: int,
type: TypeAttribute | None = None,
)
Bases: SSAValue
SSAValue that is a result of a Statement.
Source code in src/kirin/ir/ssa.py
111 112 113 114 115 116 117 | |
index class-attribute instance-attribute
index: int = index
The index of this value in the statement's result list.
owner property
owner: Statement
The object that owns this SSA value.
stmt class-attribute instance-attribute
stmt: Statement = stmt
The statement that this value is a result of.
type instance-attribute
type = type or AnyType()
The type of this SSA value.
SSAValue dataclass
SSAValue()
Bases: ABC, Printable
Base class for all SSA values in the IR.
hints class-attribute instance-attribute
hints: dict[str, Attribute] = field(
default_factory=dict, init=False, repr=False
)
Hints for this SSA value.
name property writable
name: str | None
The name of this SSA value.
name_pattern class-attribute
name_pattern: Pattern[str] = compile(
"([A-Za-z_$.-][\\w$.-]*)"
)
The pattern that the name of this SSA value must match.
owner abstractmethod property
owner: Statement | Block
The object that owns this SSA value.
type class-attribute instance-attribute
type: TypeAttribute = field(
default_factory=AnyType, init=False, repr=True
)
The type of this SSA value.
uses class-attribute instance-attribute
uses: set[Use] = field(
init=False, default_factory=set, repr=False
)
The uses of this SSA value.
add_use
add_use(use: Use) -> Self
Add a use to this SSA value.
Source code in src/kirin/ir/ssa.py
65 66 67 68 | |
delete
delete(safe: bool = True) -> None
Delete this SSA value. If safe is True, raise an error if there are uses.
Source code in src/kirin/ir/ssa.py
89 90 91 92 93 | |
remove_use
remove_use(use: Use) -> Self
Remove a use from this SSA value.
Source code in src/kirin/ir/ssa.py
70 71 72 73 74 75 76 | |
replace_by
replace_by(other: SSAValue) -> None
Replace this SSA value with another SSA value. Update all uses.
Source code in src/kirin/ir/ssa.py
78 79 80 81 82 83 84 85 86 | |
TestValue dataclass
TestValue(type: TypeAttribute = AnyType())
Bases: SSAValue
Test SSAValue for testing IR construction.
Source code in src/kirin/ir/ssa.py
221 222 223 | |
owner property
owner: Statement | Block
The object that owns this SSA value.
type instance-attribute
type = type
The type of this SSA value.