fhelium.compile.passes.program._reuse_intermediates
Reuse internal deterministic computations and simplify reference plumbing.
ReuseIntermediatesPass
class View source
ReuseIntermediatesPass(name: str = 'reuse-intermediates')Share internal pure computations while preserving observable output storage.
Reuse requires the same concrete operation, ordered SSA operands, result types, attributes and properties. Numerical materials are ordinary operands and must therefore match by SSA identity. A mutation, random draw, unknown operation, region or implementation assignment ends a local reuse run.
Shared results must reach only fresh out-of-place readers, possibly through views. Direct returns, escaping views and unknown or assigned consumers prevent sharing. This preserves independently observable result storage without changing arithmetic order, rounding or value-state transitions.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | 'reuse-intermediates' |
run
method
def run(compilation: 'Compilation') -> PassResult: ...