Compiler Interference Graph for Memory Allocation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current storage allocation techniques for integrated circuit devices, particularly in compilers, face challenges in efficiently assigning values to memory locations, especially when dealing with multiple execution engines and complex memory architectures, leading to suboptimal performance and increased latency due to the inability to effectively manage interference between values.

Innovation Solution

The proposed solution involves constructing an interference graph and calculating memory metrics to determine the optimal placement of values in memory, minimizing spill cost by assigning values to low-latency memory locations and marking values for spilling to higher-latency memory when necessary, using a compiler-driven approach that traverses and simplifies the interference graph to ensure efficient memory allocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If current storage allocation techniques are used, then memory assignment is performed, but storage allocation efficiency is poor and spill cost increases

Engineering Contradiction:
Improvestorage allocation efficiencyVSAvoidspill cost
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The compiler performs preliminary analysis during the compilation phase to construct an interference graph and calculate memory metrics before code execution. This advance planning allows optimal memory allocation decisions to be made beforehand, reducing runtime spills and improving storage allocation efficiency without executing the actual memory assignment until compilation is complete

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system calculates memory metrics such as live range, memory footprint, and access frequency, then uses this feedback information to iteratively optimize memory allocation decisions. The interference graph provides feedback on value conflicts, allowing the compiler to adjust allocation strategies to minimize spills and improve overall memory management efficiency

Inventive Principle:
Principle #23Feedback

2Productivity

If complex memory architectures with multiple execution engines are used, then parallel execution capability is improved, but managing interference between values becomes more difficult

Engineering Contradiction:
Improveparallel execution capabilityVSAvoidinterference management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The interference graph segments the memory management problem into individual value nodes and their conflicts, allowing the compiler to analyze and resolve interference between specific values independently. This segmentation makes it feasible to manage complexity in multi-engine architectures by breaking down the global interference problem into manageable local conflicts that can be resolved through systematic graph traversal and allocation algorithms

Inventive Principle:
Principle #1Segmentation

3Speed

If values are assigned to low-latency memory locations, then execution speed is improved, but memory usage optimization becomes more challenging

Engineering Contradiction:
Improveexecution speedVSAvoidmemory usage optimization
Core Design Contradiction:
SpeedVSProductivity

Solution Approach 1:

The system changes multiple parameters simultaneously including memory latency, memory footprint, access frequency, and live range duration to find optimal allocation decisions. By considering these varying parameters together through the memory metric calculations, the compiler can balance execution speed requirements against overall memory usage optimization, assigning values to low-latency memory only when the performance benefit justifies the increased memory pressure

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11934876B1Compiler-driven storage allocation of runtime values
Publication Date: 2024.03.19 AMAZON TECH INC
  • US11934876B1 patent drawing
  • US11934876B1 patent drawing
  • US11934876B1 patent drawing

AI summary

A compiler-implemented technique for performing a storage allocation is described. Computer code to be converted into machine instructions for execution on an integrated circuit device is received. Based on the computer code, a set of values that are to be stored on the integrated circuit device are determined. An interference graph that includes the set of values and a set of interferences is constructed. A number of possible placements and a number of blocked placements in a memory of the integrated circuit device are computed for each of the set of values. At least a portion of the set of values are assigned to a set of memory locations in the memory based on the numbers of possible placements and blocked placements, resulting in a set of memory location assignments.