Compiler Register Allocation Relaxation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
User-specified register constraints in programming languages like C/C++ and PL/X can lead to inflexible and inefficient register usage, limiting compiler optimizations and resulting in poor performance due to over-restriction of registers.
Innovation Solution
A processor-enabled compiler identifies and relaxes unrequired register constraints, allowing for more flexible register allocation by analyzing live range intervals and applying transformations to RR and DR variables, thereby optimizing register usage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If user-specified register constraints are strictly enforced, then program correctness is maintained, but compiler optimization freedom is reduced leading to poor performance
Solution Approach 1:
The patent changes the parameter of register constraints from fixed/user-specified to dynamic/compiler-determined. The system analyzes live range intervals and automatically adjusts register allocation, transforming the rigid parameter into a flexible one that adapts to actual program execution needs, thereby resolving the contradiction between maintaining correctness and enabling optimization.
Solution Approach 2:
The compiler is empowered to automatically analyze and relax register constraints without requiring explicit user directives. The system performs self-service by identifying unrequired constraints through live range analysis and automatically adjusting register allocation, eliminating the need for users to manually manage register restrictions while maintaining program correctness.
2Reliability
If registers are over-restricted for RR variables, then inline assembly compatibility is ensured, but register usage flexibility is reduced causing unnecessary spills
Solution Approach 1:
The patent applies local quality by differentiating register constraint requirements across different program regions. Instead of uniformly restricting registers for RR variables throughout their entire lifetime, the system analyzes live range intervals and applies restrictions only where actually needed for inline assembly compatibility, allowing flexibility in regions where constraints are unnecessary and reducing spills.
3Reliability
If DR variables are restricted from certain registers, then system call safety is maintained, but available register pool is reduced
Solution Approach 1:
The patent introduces dynamics by making register allocation for DR variables adaptive rather than static. The system dynamically determines which registers can be safely used for DR variables based on actual system call contexts and live range analysis, transforming the fixed restriction into a dynamic allocation strategy that maximizes the available register pool while maintaining system call safety.
Data Source
AI summary
A method is provided for relaxing register constraints in a computer program. The method includes identifying, by a processor enabled compiler, unrequired register constraints imposed by a user on the computer program. The unrequired register constraints are unrequired for a proper operation of the computer program. The method further includes automatically relaxing, by the processor enabled compiler, the identified unrequired register constraints to optimize register allocation for the computer program.


