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
143 144 145 146 147 148 149 |
|
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
155 156 |
|
DeletedSSAValue dataclass
DeletedSSAValue(value: SSAValue)
Bases: SSAValue
Source code in src/kirin/ir/ssa.py
178 179 180 181 |
|
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
106 107 108 109 110 111 112 |
|
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
60 61 62 63 |
|
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
84 85 86 87 88 |
|
remove_use
remove_use(use: Use) -> Self
Remove a use from this SSA value.
Source code in src/kirin/ir/ssa.py
65 66 67 68 69 70 71 |
|
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
73 74 75 76 77 78 79 80 81 |
|
TestValue dataclass
TestValue(type: TypeAttribute = AnyType())
Bases: SSAValue
Test SSAValue for testing IR construction.
Source code in src/kirin/ir/ssa.py
198 199 200 |
|
owner property
owner: Statement | Block
The object that owns this SSA value.
type instance-attribute
type = type
The type of this SSA value.