SSA Live Range Reduction for Register Allocation Under Register Limits
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing register allocation methods face challenges in efficiently mapping variables to processor registers due to limited register resources, particularly in structured control flow programs, leading to increased reliance on external memory spilling, which is not supported by some processors like AI-based accelerators.
Innovation Solution
A method is employed to reduce live ranges of variables by deriving affine expressions for each static single assignment (SSA) variable, identifying overlapping dependence edges, and eliminating the longer edges through substitution, thereby reducing the number of required registers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If traditional register allocation methods are used, then the compilation process is simple, but the number of required registers increases leading to excessive memory spilling
Solution Approach 1:
The patent applies preliminary action by performing live range reduction through affine expression propagation before the register allocation phase. The compiler analyzes and transforms variable definitions to eliminate redundant live ranges in advance, so that when register allocation occurs, fewer registers are needed and memory spilling is minimized. This pre-processing step reduces the register pressure without requiring complex allocation strategies.
2Productivity
If live range analysis is performed to map variables to registers, then register allocation can be optimized, but the number of required registers may still exceed available registers requiring memory spilling
Solution Approach 1:
The patent changes the parameter representation of variable definitions by introducing affine expressions that describe how variables transform across program points. By representing variable relationships mathematically rather than through traditional live range intervals, the system can identify and eliminate redundant variables, thereby reducing the total number of registers required while maintaining allocation efficiency.
3Reliability
If the number of live ranges exceeds available register resources, then memory spilling is required, but some processors like AI-based accelerators do not support spilling to external memory
Solution Approach 1:
The patent performs preliminary live range reduction to minimize the number of active variables before register allocation, ensuring that the reduced variable count fits within the limited register resources of processors without spilling support. This pre-optimization makes the compiled program compatible with restricted hardware architectures.
Solution Approach 2:
By transforming variable representations using affine expressions and eliminating redundant variables, the patent changes the parameter set of active variables to fit within constrained register files, enabling compilation for AI accelerators and other processors that lack memory spilling capabilities.
Data Source
AI summary
Reducing live range of variables for register allocation of structured control-flow programs is provided. The method comprises defining an affine expression for each static single assignment (SSA) variable contained in an input program for a computer compiler. The affine expression of a SSA variable in the input program is derived by substitution of affine expressions of input operands involved in computation of the SSA variable. The method defines dependence edges between nodes representing the SSA variables in a dependence graph, wherein source and destination of dependence edges represent definition and use of the SSA variables. The method identifies one or more overlapping dependence edges with a same source among the dependence edges and eliminates the longer of the overlapping dependence edges according to the derived affine expressions.


