Compiler Dependency Database Vectorization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current compiler technologies face challenges in vectorizing non-leaf loops and functions due to opaque side-effects of external function calls, limiting parallel processing and performance improvements in software applications.
Innovation Solution
The implementation of dependency databases and vector interfaces allows compilers to express and manage memory and data dependencies, enabling the vectorization of non-leaf loops and functions by exposing hidden dependencies and generating both scalar and vector versions of functions from a single source code description.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the compiler attempts to vectorize functions with external function calls, then the percentage of vectorizable functions increases, but the compiler cannot accurately determine dependencies due to opaque side-effects
Solution Approach 1:
The called function is compiled first with dependency analysis performed beforehand. The compiler generates a dependency database that captures memory and data dependencies of the called function before it is actually called from the calling function. This preliminary action provides the calling function's compiler with the necessary dependency information to safely vectorize the calling function even though the called function's source code is not visible.
Solution Approach 2:
A dependency database serves as an intermediary between the called function and the calling function. Instead of requiring direct visibility of the called function's source code, the dependency database mediates by storing and exposing dependency information (memory accesses, data dependencies) in a standardized format that the calling function's compiler can consume to make vectorization decisions.
2Reliability
If the compiler vectorizes only leaf loops (functions without external calls), then dependency analysis is accurate, but the vast majority of software functions cannot be vectorized
Solution Approach 1:
The system performs dependency analysis in advance during the compilation of called functions, storing results in a dependency database. This allows the calling function's compiler to access pre-computed dependency information without needing to perform its own complex analysis of the called function, thereby maintaining reliability while enabling vectorization of the broader class of functions with external calls.
Solution Approach 2:
Instead of analyzing the actual called function source code during vectorization of the calling function, the system uses a copy of the dependency information (extracted beforehand and stored in the dependency database) to make vectorization decisions. This copying approach allows accurate dependency analysis without requiring direct access to the called function's implementation.
3Device complexity
If the compiler generates only scalar versions of functions, then the interface remains simple, but parallel processing performance is limited
Solution Approach 1:
The compiler generates both scalar and vector versions of functions from a single source code description. The dependency database stores interface information that describes both scalar and vector versions, allowing the same function to be called in both scalar and vector modes depending on the needs of the calling function. This multi-functionality enables the system to maintain simplicity while achieving enhanced parallel processing performance.
Solution Approach 2:
The system changes the parameter types in the function interface to support both scalar and vector operations. By generating vector versions of functions with vector parameters and vector return values alongside scalar versions, the compiler enables the calling function to choose the appropriate version based on vectorization opportunities, thereby improving parallel processing performance without fundamentally changing the interface simplicity.
Data Source
AI summary
Systems and methods for the vectorization of software applications are described. In some embodiments, a compiler may automatically generate both scalar and vector versions of a function from a single source code description. A vector interface may be exposed in a persistent dependency database that is associated with the function. This may allow a compiler to make vector function calls from within vectorized loops, rather than making multiple serialized scalar function calls from within a vectorized loop. This may in turn facilitate the vectorization of hierarchical code, which may improve application performance when vector execution resources are available.


