[−][src]Module peepmatic_runtime::paths
Representing paths through the dataflow graph.
Paths are relative from a root instruction, which is the instruction we are determining which, if any, optimizations apply.
Paths are series of indices through each instruction's children as we
traverse down the graph from the root. Children are immediates followed by
arguments: [imm0, imm1, ..., immN, arg0, arg1, ..., argN]
.
Examples
[0]
is the path to the root.[0, 0]
is the path to the root's first child.[0, 1]
is the path to the root's second child.[0, 1, 0]
is the path to the root's second child's first child.
Interning
To avoid extra allocations, de-duplicate paths, and reference them via a
fixed-length value, we intern paths inside a PathInterner
and then
reference them via PathId
.
Structs
Path | A path through the data-flow graph from the root instruction. |
PathId | An identifier for an interned path. |
PathInterner | An interner and de-duplicator for |