Compiler Storage Aliasing Control Using Artificial Dependences
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compilers for parallel processing systems like GPUs may adjust scheduling and allocation in a manner that results in suboptimal performance for certain computations, particularly matrix and machine learning operations.
Innovation Solution
Implementing artificial dependences during program compilation to control the allocation of program variables to memory resources, such as registers, based on detected data flow relationships, allowing for improved code execution performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If compilers automatically adjust scheduling and allocation of operations to registers, then code execution can be optimized, but performance may become suboptimal for certain computations due to storage aliasing
Solution Approach 1:
The system performs preliminary analysis of data flow relationships before code generation, identifying storage aliasing patterns in advance. By detecting dependence relationships between operations and their referenced variables beforehand, the compiler can pre-determine optimal allocation strategies, preventing suboptimal performance before it occurs.
Solution Approach 2:
The system introduces an intermediary analysis layer between source code and machine code generation. This intermediary detects data flow relationships and storage aliasing patterns, then uses this information to guide register allocation and scheduling decisions, acting as a mediator that prevents suboptimal compilation outcomes.
2Quantity of substance
If the compiler allocates program variables to the same storage locations, then storage efficiency improves, but execution performance deteriorates due to storage aliasing conflicts
Solution Approach 1:
The system applies different allocation strategies to different variable pairs based on their specific data flow relationships. Rather than applying a uniform allocation rule, it analyzes local dependence patterns between specific operations and variables, allowing optimal storage location assignment for each case while maintaining overall storage efficiency.
Solution Approach 2:
The system dynamically changes allocation parameters based on detected data flow characteristics. By monitoring dependence relationships and storage aliasing patterns, the compiler adjusts allocation decisions in real-time, changing which variables share storage locations based on their computational relationships, thus balancing storage efficiency with execution performance.
Data Source
AI summary
In various examples, systems and methods are disclosed relating to aliasing control of program variables in storage via automatic application of artificial dependences during program compilation. In some implementations, a system can include a detector to automatically detect a pattern, based at least on a structure of data flow in a source program, indicative of sequences of dependent operations, where the sequences are independent from one another. The system can determine a storage aliasing preference for whether to allow the compiler to allocate the program variables of the respective sequences to the same processor storage locations, or to prevent the compiler from doing so. The system can assign one or more annotations to the source program indicative of one or more artificial dependences for a compiler to respect when performing program transformations prior to the allocation of program variables.


