lib-script · crate
kinogaki-script-ir
lib-script's column IR: typed SSA values (vectors as groups of scalar values) in structured regions; lowering from the checked program; uniform/varying analysis; optimisation; a verifier; and the fault table that maps instructions back to source spans.
- Repository
- lib-script (kinogaki/lib-script)
- Folder
libs/lib-script/crates/ir- Source
- 14 files, 3,486 lines
- Tests
- 0 files, 0 lines
What it is
lib-script's column IR: typed SSA values (vectors as groups of scalar values) in structured regions; lowering from the checked program; uniform/varying analysis; optimisation; a verifier; and the fault table that maps instructions back to source spans.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-math | lib-math | normal | Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions. |
kinogaki-script-host | lib-script | normal | The boundary between lib-script and a host. |
kinogaki-script-syntax | lib-script | normal | lib-script's syntax: an indentation-aware lexer, a recovering parser and a syntax tree whose every node keeps the exact span of its text. |
kinogaki-script-types | lib-script | normal | lib-script's front end after parsing: types, the host schema a context offers, the library catalog's signatures, the checker that builds the typed program, and completion and hover for the editor. |
Third-party
None.
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-script-exec | lib-script | normal | lib-script's engine: a column (batch) interpreter in safe Rust. |
kinogaki-script-lib | lib-script | normal | lib-script's function library. |
Modules
builderBuilding programs: instructions appended to the current region.123 linesdumpA readable listing of a program, for debugging and tests.49 linesemitOne description of a computation, two readings:Emitis implemented by the IRBuilder(which records column instructions) and byDirect(which computes on f64 at once).106 linesformsProducts the language builds in, written once againstEmitso the lowering and the scalar reference compute them the same way.96 linesirThe column IR: typed SSA values in structured regions.351 lineslibraryWhat lowering needs from the function library.15 lineslowerFrom the typed program to the column IR.709 lineslower::expr(private)Expressions: each lowers to its components' values.358 lineslower::stmt(private)Statements and assignment.335 linesoptOptimisation: constant folding (parameters too, when the program was lowered with their values), branch removal on constant conditions, common subexpressions, unchanging loop values, and dead code.516 linessemWhat each operation computes, once, for every user: constant folding, the column engine's lane loops and the scalar reference interpreter all call these, so they agree to the bit.321 linesuniformUniform/varying analysis: which values are the same on every lane (constants, parameters, detail values and what is computed only from them) and which vary per element.150 linesverifyThe verifier: every value defined once before use (in its region or an enclosing one), operand and result kinds as each op wants, regions used once, yields matching results, stores only at the top, sites where faults can happen.324 lines
Public types and traits
At the crate root
Traits EmitLibrary
Structs BuilderBuiltDirectFaultSiteInputInstLoweredProgramRegionUniformity
Enums BinFaultKindOpUn
Type aliases RegionIdSiteSlotIdV
By module: 20 public types and traits in 6 modules
builder Builder
emit DirectEmit
ir BinFaultKindFaultSiteInstOpProgramRegionRegionIdSiteSlotIdSlotInfoUnV
library Library
lower InputLowered
uniform Uniformity
Besides these, 29 public functions at module level.
