Compiler Register Allocation Relaxation

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveprogram correctnessVSAvoidcompiler optimization freedom
Core Design Contradiction:
ReliabilityVSProductivity

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.

Inventive Principle:
Principle #35Parameter changes

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.

Inventive Principle:
Principle #25Self-service

2Reliability

If registers are over-restricted for RR variables, then inline assembly compatibility is ensured, but register usage flexibility is reduced causing unnecessary spills

Engineering Contradiction:
Improveinline assembly compatibilityVSAvoidregister usage flexibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

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.

Inventive Principle:
Principle #3Local quality

3Reliability

If DR variables are restricted from certain registers, then system call safety is maintained, but available register pool is reduced

Engineering Contradiction:
Improvesystem call safetyVSAvoidavailable register pool
Core Design Contradiction:
ReliabilityVSQuantity of substance

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.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10275228B2Relaxing user-specified register constraints for improving register allocation
Publication Date: 2019.04.30 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10275228B2 patent drawing
  • US10275228B2 patent drawing
  • US10275228B2 patent drawing

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.