Compiler Array Access Pattern Alignment for SIMD Memory Penalties
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing multimedia extensions for general-purpose processors face performance penalties due to unaligned memory loads and register spills in array-based programs, which are common in SIMD operations.
Innovation Solution
A method and compiler logic that identify and analyze array access patterns, calculate distances between them, and share address calculations to optimize alignment, reducing register pressure and memory penalties by executing fully aligned portions of code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If array-based programs are used for multimedia extensions, then programming flexibility is improved, but memory penalties due to unaligned loads increase
Solution Approach 1:
The patent segments the code into aligned and unaligned portions, allowing the aligned portion to be executed with optimized memory access patterns while the unaligned portion handles edge cases. This segmentation enables the system to maintain programming flexibility while minimizing memory penalties by executing aligned code paths when possible.
Solution Approach 2:
The patent applies different alignment strategies to different portions of the code. The aligned portion uses strict alignment for optimal performance, while the unaligned portion handles cases where alignment cannot be maintained. This local differentiation allows the system to maximize performance where possible without sacrificing programming flexibility entirely.
2Adaptability or versatility
If array-based programs are used for multimedia extensions, then programming flexibility is improved, but stack spills and refills increase
Solution Approach 1:
The patent segments the execution into aligned and unaligned paths, where the aligned path is optimized to minimize register pressure and stack operations. By separating the code paths, the system can maintain programming flexibility while reducing stack spills and refills in the primary execution path.
Solution Approach 2:
The patent changes the alignment parameter of memory accesses in the aligned portion, transforming unaligned accesses into aligned ones. This parameter change eliminates stack spills and refills associated with misaligned memory operations while preserving the flexibility of the original array-based programming model.
3Loss of energy
If aligned code is executed, then memory penalties are reduced, but code complexity increases
Solution Approach 1:
The patent segments the original code into aligned and unaligned portions, allowing the aligned portion to benefit from optimized memory access while the unaligned portion handles edge cases. This segmentation manages code complexity by organizing the code into distinct, manageable sections with clear purposes.
Solution Approach 2:
The patent extracts the alignment optimization into a separate aligned portion of the code, isolating the complexity of alignment handling from the main execution path. This extraction allows the primary code to benefit from simplified memory access patterns while the extracted portion handles the complexity of alignment transitions.
Data Source
AI summary
A device identifies array accesses of variables in a program code that includes multiple arrays, and identifies array access patterns for one of the array accesses. The device also determines an order of the array access patterns identified for the array accesses, and calculates, based on the order, distances between the array access patterns. The device further shares address calculations amongst the array accesses associated with array access patterns with one or more of the distances that are equivalent.


