tir/lower — TIR to Assembly Backend
Consumes Vec<TIROp> and produces Triton VM assembly (TASM).
Files
Triton lowering strategies
| Construct |
Strategy |
IfElse |
deferred subroutines: skiz+call (flush_deferred) |
IfOnly |
skiz+call to deferred block |
Loop |
labeled subroutine with recurse |
FnStart |
__name: label |
FnEnd |
flushes deferred blocks |
Open |
push tag; write_io 1 per field |
Seal |
pad + hash + write_io 5 |
Adding a backend
- Create
new_target.rs implementing StackLowering (one method: fn lower(&self, ops: &[TIROp]) -> Vec<String>)
- Register in
create_stack_lowering
- Add a
TerrainConfig variant
Dependencies
TIROp — the IR operations consumed by lowering
TIRBuilder — used in regression tests