IRStrahler
IRStrahler is a metric used in compiler analysis to assign Strahler numbers to nodes in an intermediate representation (IR) graph. It generalizes the classic Strahler number, which originated for trees, to directed graphs that model data dependencies in an IR. The resulting numbers provide a compact summary of the structural complexity of expressions and can help understand resource requirements and optimization opportunities.
Definition and computation: For a node v, if v has no predecessors, its Strahler number S(v) is
In practice, IRStrahler is often computed on the IR’s data-flow graph, and in SSA form phi nodes
Applications and limitations: IRStrahler helps estimate register pressure and informs scheduling and allocation decisions, guiding optimizations