Compiler Multi-Version Code Generation for Processor Architecture Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compiler technologies face inefficiencies in generating machine code that is compatible with multiple processor architectures and versions, leading to code bloating, increased system resources, and sub-optimal operational efficiency, as they often require maintaining multiple object code sets and using fat objects which result in performance issues and resource inefficiencies.
Innovation Solution
A compiler that selectively generates machine code for specific C++ functions in a multi-version mode, creating a single executable that can run on various processor architectures by identifying functions to be 'multiversioned', generating internal representations for different processor versions, and replacing function calls with function pointers to the appropriate machine code versions based on the executing processor architecture.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If separate programs are written for each processor architecture and version, then execution efficiency on specific architectures is improved, but development time and cost increase significantly
Solution Approach 1:
The patent segments the codebase by identifying specific functions that benefit from architecture-specific optimizations while keeping the rest of the codebase unified. The compiler automatically generates architecture-specific versions only for identified functions, rather than requiring separate programs for entire applications.
Solution Approach 2:
The patent changes the parameter of code generation by using a single source code base that can be compiled into different machine code versions based on the target processor architecture. The compiler adjusts compilation parameters automatically to generate optimized code for different architectures without requiring separate source codes.
2Adaptability or versatility
If the lowest level architecture is used to ensure compatibility across all processor versions, then broad compatibility is achieved, but execution performance deteriorates
Solution Approach 1:
The patent makes the code execution dynamic by enabling the program to select and execute architecture-specific function versions at runtime based on the detected processor architecture. This allows the system to adapt to different architectures while maintaining compatibility, rather than being locked into a single lowest-common-denominator implementation.
3Speed
If multiple object code sets are maintained for different processor versions, then architecture-specific optimization is achieved, but system resource utilization increases
Solution Approach 1:
The patent creates a universal executable that contains multiple architecture-specific function versions and automatically selects the appropriate version based on the runtime processor architecture. This single executable serves multiple functions across different architectures, eliminating the need to maintain and load separate object code sets for each architecture.
4Adaptability or versatility
If fat objects with multiple architecture code sets are used, then multi-architecture support is achieved, but code bloating occurs
Solution Approach 1:
The patent extracts only the necessary architecture-specific code portions (specific functions) into separate versions, rather than including complete duplicate code sets for each architecture. The compiler identifies and extracts only those functions that require architecture-specific optimization, keeping the overall code size minimal.
Data Source
AI summary
Utilities for use in generation of a single executable (e.g., single set of machine code) compatible with processors of multiple different architectures and/or versions with reduced levels of code bloating, no or limited changes to the source code, no or limited special code and/or data sections in the executable, and the like. Specifically, a compiler can selectively generate machine code for each of one or more particular C++ functions for each of a plurality of different processor versions and/or architectures in a “multi-version mode” or “multi-architecture mode” to allow such functions to perform better under different processor versions or architectures, avoid the need to maintain multiple entire object code sets for different processor versions or architectures, and allow for maintenance of a substantially complete C++ code mechanism.


