Function
Warning
This page is under construction. The content may be incomplete or incorrect. Submit an issue on GitHub if you need help or want to contribute.
Call krin-statement
Call(
callee: SSAValue,
inputs: tuple[SSAValue, ...],
*,
kwargs: tuple[str, ...] = ()
)
Bases: Statement
callee kirin-argument
callee: SSAValue = argument()
inputs kirin-argument
inputs: tuple[SSAValue, ...] = argument()
kwargs kirin-property
kw-only
kwargs: tuple[str, ...] = attribute(
default_factory=lambda: (), property=True
)
name class-attribute
instance-attribute
name = 'call'
result kirin-result
result: ResultValue = result()
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
81 82 |
|
ConstantNone krin-statement
ConstantNone()
Bases: Statement
A constant None value.
This is mainly used to represent the None return value of a function to match Python semantics.
name class-attribute
instance-attribute
name = 'const.none'
result kirin-result
result: ResultValue = result(NoneType)
traits class-attribute
instance-attribute
traits = frozenset({Pure(), ConstantLike()})
FuncOpCallableInterface dataclass
FuncOpCallableInterface()
Bases: CallableStmtInterface['Function']
get_callable_region classmethod
get_callable_region(stmt: Function) -> Region
Returns the body of the callable region
Source code in src/kirin/dialects/func/stmts.py
29 30 31 |
|
Function krin-statement
Function(
*, sym_name: str, signature: Signature, body: Region
)
Bases: Statement
body kirin-region
kw-only
body: Region = region(multi=True)
name class-attribute
instance-attribute
name = 'func'
signature kirin-attribute
kw-only
signature: Signature = attribute()
sym_name kirin-property
kw-only
sym_name: str = attribute(property=True)
The symbol name of the function.
traits class-attribute
instance-attribute
traits = frozenset(
{
IsolatedFromAbove(),
SymbolOpInterface(),
HasSignature(),
FuncOpCallableInterface(),
SSACFGRegion(),
}
)
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
GetField krin-statement
GetField(obj: SSAValue, *, field: int)
Bases: Statement
field kirin-property
kw-only
field: int = attribute(property=True)
name class-attribute
instance-attribute
name = 'getfield'
obj kirin-argument
obj: SSAValue = argument(MethodType)
result kirin-result
result: ResultValue = result(init=False)
traits class-attribute
instance-attribute
traits = frozenset({Pure()})
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
189 190 191 192 193 194 195 196 |
|
Invoke krin-statement
Invoke(
inputs: tuple[SSAValue, ...],
*,
callee: Method,
kwargs: tuple[str, ...]
)
Bases: Statement
callee kirin-property
kw-only
callee: Method = attribute(property=True)
inputs kirin-argument
inputs: tuple[SSAValue, ...] = argument()
kwargs kirin-property
kw-only
kwargs: tuple[str, ...] = attribute(property=True)
name class-attribute
instance-attribute
name = 'invoke'
result kirin-result
result: ResultValue = result()
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
207 208 |
|
verify
verify() -> None
run mandatory validation checks. This is not same as typecheck, which may be optional.
Source code in src/kirin/dialects/func/stmts.py
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
Lambda krin-statement
Lambda(
captured: tuple[SSAValue, ...],
*,
sym_name: str,
signature: Signature,
body: Region
)
Bases: Statement
body kirin-region
kw-only
body: Region = region(multi=True)
captured kirin-argument
captured: tuple[SSAValue, ...] = argument()
name class-attribute
instance-attribute
name = 'lambda'
result kirin-result
result: ResultValue = result(MethodType)
signature kirin-attribute
kw-only
signature: Signature = attribute()
sym_name kirin-property
kw-only
sym_name: str = attribute(property=True)
traits class-attribute
instance-attribute
traits = frozenset(
{
Pure(),
SymbolOpInterface(),
FuncOpCallableInterface(),
SSACFGRegion(),
}
)
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
verify
verify() -> None
run mandatory validation checks. This is not same as typecheck, which may be optional.
Source code in src/kirin/dialects/func/stmts.py
155 156 157 |
|
Return krin-statement
Return(value_or_stmt: SSAValue | Statement | None = None)
Bases: Statement
Source code in src/kirin/dialects/func/stmts.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
name class-attribute
instance-attribute
name = 'return'
traits class-attribute
instance-attribute
traits = frozenset({IsTerminator(), HasParent((Function))})
value kirin-argument
value: SSAValue = argument()
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/func/stmts.py
121 122 123 124 125 126 127 |
|
verify
verify() -> None
run mandatory validation checks. This is not same as typecheck, which may be optional.
Source code in src/kirin/dialects/func/stmts.py
129 130 131 132 133 134 135 136 137 138 139 140 |
|