Eqsat pdl interp
eqsat_pdl_interp
A dialect that extends pdl_interp with eqsat-specific operations.
EqSatPDLInterp = Dialect('eqsat_pdl_interp', [GetResultOp, GetResultsOp, GetDefiningOpOp, ReplaceOp, CreateOperationOp, RecordMatchOp, FinalizeOp, ChooseOp])
module-attribute
GetResultOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
name = 'eqsat_pdl_interp.get_result'
class-attribute
instance-attribute
index = prop_def(IntegerAttr[I32])
class-attribute
instance-attribute
input_op = operand_def(OperationType)
class-attribute
instance-attribute
value = result_def(ValueType)
class-attribute
instance-attribute
assembly_format = '$index `of` $input_op attr-dict'
class-attribute
instance-attribute
__init__(index: int | IntegerAttr[I32], input_op: SSAValue) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
59 60 61 62 63 64 | |
GetResultsOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
name = 'eqsat_pdl_interp.get_results'
class-attribute
instance-attribute
index = opt_prop_def(IntegerAttr[I32])
class-attribute
instance-attribute
input_op = operand_def(OperationType)
class-attribute
instance-attribute
value = result_def(ValueType | RangeType[ValueType])
class-attribute
instance-attribute
__init__(index: int | IntegerAttr[I32] | None, input_op: SSAValue, result_type: ValueType | RangeType[ValueType]) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
81 82 83 84 85 86 87 88 89 90 91 92 93 | |
parse(parser: Parser) -> GetResultsOp
classmethod
Source code in xdsl/dialects/eqsat_pdl_interp.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
print(printer: Printer)
Source code in xdsl/dialects/eqsat_pdl_interp.py
110 111 112 113 114 115 116 117 | |
GetDefiningOpOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
name = 'eqsat_pdl_interp.get_defining_op'
class-attribute
instance-attribute
value = operand_def(ValueType | RangeType[ValueType])
class-attribute
instance-attribute
input_op = result_def(OperationType)
class-attribute
instance-attribute
assembly_format = '`of` $value `:` type($value) attr-dict'
class-attribute
instance-attribute
__init__(value: SSAValue) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
132 133 | |
ReplaceOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
name = 'eqsat_pdl_interp.replace'
class-attribute
instance-attribute
input_op = operand_def(OperationType)
class-attribute
instance-attribute
repl_values = var_operand_def(ValueType | RangeType[ValueType])
class-attribute
instance-attribute
assembly_format = '$input_op `with` ` ` `(` ($repl_values^ `:` type($repl_values))? `)` attr-dict'
class-attribute
instance-attribute
__init__(input_op: SSAValue, repl_values: list[SSAValue]) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
150 151 | |
CreateOperationOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
name = 'eqsat_pdl_interp.create_operation'
class-attribute
instance-attribute
constraint_name = prop_def(StringAttr, prop_name='name')
class-attribute
instance-attribute
input_attribute_names = prop_def(ArrayAttr[StringAttr], prop_name='inputAttributeNames')
class-attribute
instance-attribute
inferred_result_types = opt_prop_def(UnitAttr, prop_name='inferredResultTypes')
class-attribute
instance-attribute
input_operands = var_operand_def(ValueType | RangeType[ValueType])
class-attribute
instance-attribute
input_attributes = var_operand_def(AttributeType | RangeType[AttributeType])
class-attribute
instance-attribute
input_result_types = var_operand_def(TypeType | RangeType[TypeType])
class-attribute
instance-attribute
result_op = result_def(OperationType)
class-attribute
instance-attribute
irdl_options = (AttrSizedOperandSegments(as_property=True),)
class-attribute
instance-attribute
__init__(name: str | StringAttr, inferred_result_types: UnitAttr | None = None, input_attribute_names: Iterable[StringAttr] | None = None, input_operands: Sequence[SSAValue] | None = None, input_attributes: Sequence[SSAValue] | None = None, input_result_types: Sequence[SSAValue] | None = None) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
parse(parser: Parser) -> CreateOperationOp
classmethod
Source code in xdsl/dialects/eqsat_pdl_interp.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
print(printer: Printer)
Source code in xdsl/dialects/eqsat_pdl_interp.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
RecordMatchOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
name = 'eqsat_pdl_interp.record_match'
class-attribute
instance-attribute
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
rewriter = prop_def(SymbolRefAttr)
class-attribute
instance-attribute
rootKind = opt_prop_def(StringAttr)
class-attribute
instance-attribute
generatedOps = opt_prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
benefit = prop_def(IntegerAttr[I16])
class-attribute
instance-attribute
inputs = var_operand_def(AnyPDLTypeConstr)
class-attribute
instance-attribute
matched_ops = var_operand_def(OperationType)
class-attribute
instance-attribute
dest = successor_def()
class-attribute
instance-attribute
irdl_options = (AttrSizedOperandSegments(as_property=True),)
class-attribute
instance-attribute
assembly_format = '$rewriter (`(` $inputs^ `:` type($inputs) `)`)? `:` `benefit` `(` $benefit `)` `,`(`generatedOps` `(` $generatedOps^ `)` `,`)? `loc` `(` `[` $matched_ops `]` `)`(`,` `root` `(` $rootKind^ `)`)? attr-dict `->` $dest'
class-attribute
instance-attribute
__init__(rewriter: str | SymbolRefAttr, root_kind: str | StringAttr | None, generated_ops: ArrayAttr[StringAttr] | None, benefit: int | IntegerAttr[I16], inputs: Sequence[SSAValue], matched_ops: Sequence[SSAValue], dest: Block) -> None
Source code in xdsl/dialects/eqsat_pdl_interp.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
FinalizeOp
Bases: IRDLOperation
See external documentation.
Source code in xdsl/dialects/eqsat_pdl_interp.py
381 382 383 384 385 386 387 388 389 390 391 392 393 | |
name = 'eqsat_pdl_interp.finalize'
class-attribute
instance-attribute
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
assembly_format = 'attr-dict'
class-attribute
instance-attribute
__init__()
Source code in xdsl/dialects/eqsat_pdl_interp.py
392 393 | |
ChooseOp
Bases: IRDLOperation
This operation can be used in pdl_interp matchers and integrates with the backtracking mechanism. It holds multiple "choices" (successors). When this operation is encountered, a BacktrackPoint is stored, and the choice is visited. When this execution of this choice eventually finalizes, the backtracking logic will jump to the next choice, until all choices are exhausted. Finally, the default successor is visited.
Source code in xdsl/dialects/eqsat_pdl_interp.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
name = 'eqsat_pdl_interp.choose'
class-attribute
instance-attribute
default_dest = successor_def()
class-attribute
instance-attribute
choices = var_successor_def()
class-attribute
instance-attribute
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
assembly_format = '`from` $choices `then` $default_dest attr-dict'
class-attribute
instance-attribute
__init__(choices: Sequence[Block], default: Block)
Source code in xdsl/dialects/eqsat_pdl_interp.py
414 415 416 417 | |