Inline Function Linking for Dead Code Elimination

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing linker-level dead code elimination techniques consume significant processing power and energy, especially in real-time or power-sensitive devices, due to the need to evaluate thousands of functions to determine reachability, making them inefficient for sparse library utilization.

Innovation Solution

Implementing 'lazy' linking that copies only reachable library functions, performing inline dead code elimination by evaluating and selectively copying only the necessary functions, thereby reducing memory copies and power consumption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the linker copies the entire library into the destination file, then all library functions are available for execution, but the memory consumption and processing power required increase significantly

Engineering Contradiction:
Improveavailability of library functionsVSAvoidmemory consumption
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent extracts only the necessary library functions that are actually referenced by the user-defined code into the destination file, rather than copying the entire library. This is achieved through a two-pass approach: first copying the user-defined code and identifying referenced library functions, then selectively copying only those specific functions. This extraction principle directly resolves the contradiction by maintaining function availability while reducing memory consumption.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent segments the library copying process into distinct phases: (1) copying user-defined code, (2) identifying referenced library functions through symbol table analysis, and (3) selectively copying only the necessary library portions. This segmentation allows the system to avoid copying unused library functions, thereby reducing memory consumption while ensuring all required functions are available.

Inventive Principle:
Principle #1Segmentation

2Manufacturing precision

If the linker evaluates all functions to determine reachability, then dead code elimination is effective, but the processing time and energy consumption increase substantially

Engineering Contradiction:
Improvedead code elimination accuracyVSAvoidprocessing time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent performs preliminary action by first copying the user-defined code to the destination file before evaluating library function reachability. This establishes a baseline that limits the scope of subsequent analysis to only those library functions referenced by the user code, rather than evaluating all library functions. This preliminary step significantly reduces processing time while maintaining elimination accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent extracts and analyzes only the symbol table information necessary to determine which library functions are referenced by user-defined code. By focusing analysis exclusively on this subset rather than all library functions, the system achieves effective dead code elimination with substantially reduced processing time and energy consumption.

Inventive Principle:
Principle #2Taking out (Extraction)

3Quantity of substance

If the linker copies only referenced library functions, then memory consumption is reduced, but the complexity of determining reachability increases

Engineering Contradiction:
Improvememory consumptionVSAvoidlinker complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent introduces symbol tables as an intermediary mechanism to manage the complexity of determining library function reachability. The symbol tables store references between user-defined code and library functions, allowing the linker to efficiently identify which library functions are needed without complex analysis. This intermediary structure reduces linker complexity while enabling selective copying to reduce memory consumption.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent uses copying of symbol table information from the user-defined code to identify referenced library functions. This copying approach is simpler than performing complex reachability analysis, as it directly reveals which library functions are needed. The symbol table copying mechanism manages complexity while enabling the selective copying strategy that reduces memory consumption.

Inventive Principle:
Principle #26Copying

4Use of energy by moving object

If the linker performs selective copying of library functions, then power consumption is reduced, but the time required to identify reachable functions increases

Engineering Contradiction:
Improvepower consumptionVSAvoidfunction identification time
Core Design Contradiction:
Use of energy by moving objectVSLoss of time

Solution Approach 1:

The patent performs preliminary action by establishing the user-defined code in the destination file first, which defines the boundary for subsequent analysis. This preliminary step reduces the scope of power-consuming analysis to only library functions referenced by user code, rather than all library functions. The time required is reduced because the analysis scope is pre-limited by the user code boundaries.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The symbol tables serve as an intermediary that reduces both power consumption and identification time. By using pre-computed symbol table information rather than performing complex reachability analysis, the system minimizes power-consuming operations while quickly identifying reachable functions through direct symbol table lookup and analysis.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8935683B2Inline function linking
Publication Date: 2015.01.13 QUALCOMM INC
  • US8935683B2 patent drawing
  • US8935683B2 patent drawing
  • US8935683B2 patent drawing

AI summary

In general, techniques are described for performing a form of inline dead code elimination. An apparatus comprising a storage unit and a processor may implement these techniques. The storage unit stores two source files and a destination file. The processor copies a first one of the source files to the destination file. This first source file includes a reference to a portion of a second one of the source files. The processor then evaluates the destination file to determine whether the portion of the second source file referenced in the first source file is used by the destination file. Based on the determination that the portion of the second source file referenced in the first source file is used by the destination file, the processor selectively copies the portion of the second source file to the destination file to generate an updated destination file.