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.
SCF Dialects
Reference
For krin-statement
For(
iterable: ir.SSAValue,
body: ir.Region,
*initializers: ir.SSAValue
)
Bases: Statement
Source code in src/kirin/dialects/scf/stmts.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
body kirin-region
kw-only
body: Region = region(multi=False)
initializers kirin-argument
initializers: tuple[SSAValue, ...] = argument(Any)
iterable kirin-argument
iterable: SSAValue = argument(Any)
name class-attribute
instance-attribute
name = 'for'
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/scf/stmts.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
verify
verify() -> None
run mandatory validation checks. This is not same as typecheck, which may be optional.
Source code in src/kirin/dialects/scf/stmts.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
IfElse krin-statement
IfElse(
cond: ir.SSAValue,
then_body: ir.Region | ir.Block,
else_body: ir.Region | ir.Block | None = None,
)
Bases: Statement
Python-like if-else statement.
This statement has a condition, then body, and else body.
Then body either terminates with a yield statement or scf.return
.
Source code in src/kirin/dialects/scf/stmts.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
cond kirin-argument
cond: SSAValue = argument(Any)
else_body kirin-region
kw-only
else_body: Region = region(
multi=False, default_factory=Region
)
name class-attribute
instance-attribute
name = 'if'
then_body kirin-region
kw-only
then_body: Region = region(multi=False)
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/scf/stmts.py
77 78 79 80 81 82 83 84 85 |
|
Yield krin-statement
Yield(*values: ir.SSAValue)
Bases: Statement
Source code in src/kirin/dialects/scf/stmts.py
167 168 |
|
name class-attribute
instance-attribute
name = 'yield'
traits class-attribute
instance-attribute
traits = frozenset({IsTerminator()})
values kirin-argument
values: tuple[SSAValue, ...] = argument(Any)
print_impl
print_impl(printer: Printer) -> None
Source code in src/kirin/dialects/scf/stmts.py
170 171 172 |
|