Convert op
convert_op
CastInstrWithFlags
Bases: CastInstr
Source code in xdsl/backend/llvm/convert_op.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
__init__(parent: LLVMBlock, op: str, val: Value, typ: Type, name: str = '', flags: tuple[str, ...] | list[str] = ())
Source code in xdsl/backend/llvm/convert_op.py
114 115 116 117 118 119 120 121 122 123 124 125 | |
descr(buf: list[str]) -> None
Source code in xdsl/backend/llvm/convert_op.py
127 128 129 130 131 132 133 134 | |
intrinsic_suffix(t: ir.Type) -> str
Return the LLVM intrinsic name suffix for a type, e.g. 'f32' or 'v4f32'.
Source code in xdsl/backend/llvm/convert_op.py
379 380 381 382 383 384 385 | |
declare_intrinsic(module: ir.Module, name: str, ty: ir.Type, fnty: ir.FunctionType) -> ir.Function
Declare an LLVM intrinsic with a type-mangled name, reusing an existing declaration if present.
Source code in xdsl/backend/llvm/convert_op.py
388 389 390 391 392 393 394 395 396 397 398 | |
convert_op(op: Operation, builder: ir.IRBuilder, val_map: dict[SSAValue, ir.Value], block_map: dict[Block, LLVMBlock] | None = None)
Convert an xDSL operation to an llvmlite LLVM IR.
Side effects
Mutates val_map by adding entries for the operation's results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
op
|
Operation
|
The xDSL operation to convert |
required |
builder
|
IRBuilder
|
The LLVM IR builder for constructing instructions |
required |
val_map
|
dict[SSAValue, Value]
|
The Mapping from xDSL SSA values to LLVM IR values. This dictionary is mutated to store the LLVM IR value produced by this operation for use by subsequent operations. |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If the operation is not supported. |
Source code in xdsl/backend/llvm/convert_op.py
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |