Local Entry Point Optimization for Indirect Function Calls

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computer systems face inefficiencies in using indirect function calls due to the need for recalculating global entry points, which can lead to increased processor resource utilization and reduced performance when calling functions across different shared objects.

Innovation Solution

Implementing a system that allows the use of local entry points for indirect function calls, where possible, by determining if a function pointer value is local-use-only and optimizing call sites to skip loading or restoring the table of contents pointer register, thereby reducing unnecessary calculations and improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If global entry points are used for indirect function calls, then functions can be called across different shared objects, but processor resource utilization increases and performance decreases due to recalculating TOC pointers

Engineering Contradiction:
Improvefunction call capability across shared objectsVSAvoidprocessor efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies local quality by differentiating between global and local entry points based on the calling context. When the caller and callee are in the same shared object, a local entry point is used that skips TOC pointer loading/restoring. Whenč·¨ shared object, a global entry point is used that includes full TOC pointer handling. This contextual differentiation optimizes performance for local calls while maintaining correctness for global calls.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent implements dynamics by making the entry point selection dynamic based on runtime conditions. The system determines whether to use a local or global entry point based on whether the caller and callee share the same TOC pointer value, allowing the system to adapt its behavior to the specific calling context and optimize performance accordingly.

Inventive Principle:
Principle #15Dynamics

2Reliability

If TOC pointer loading and restoring instructions are executed for every indirect function call, then correct function invocation is ensured, but unnecessary calculations increase and performance decreases

Engineering Contradiction:
Improvefunction invocation correctnessVSAvoidcall overhead
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by executing only the necessary subset of TOC pointer operations for each indirect function call. When the caller and callee share the same TOC pointer, the system performs a partial operation (skipping TOC pointer loading/restoring) rather than the full operation sequence, reducing overhead while maintaining correctness through conditional logic.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent substitutes the mechanical execution of TOC pointer loading/restoring instructions with a conditional check mechanism. Instead of always executing the full sequence of TOC pointer operations, the system uses a conditional check (via the local entry point indicator) to substitute the mechanical operations with a more efficient path when applicable.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

3Productivity

If local entry points are used to skip TOC pointer operations, then processor efficiency improves, but the system must determine whether local-use-only applies

Engineering Contradiction:
Improveprocessor efficiencyVSAvoidentry point selection logic
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by pre-marking function pointers during compilation or linking with a local-use-only indicator when appropriate. This preliminary classification allows the runtime system to quickly determine whether to use local or global entry points without complex runtime analysis, reducing the complexity of the selection logic while maintaining optimization opportunities.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10268465B2Executing local function call site optimization
Publication Date: 2019.04.23 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10268465B2 patent drawing
  • US10268465B2 patent drawing
  • US10268465B2 patent drawing

AI summary

Embodiments relate to using a local entry point with an indirect call function. More specifically, an indirect call function configuration comprises a first application module having a target function of the indirect function call, a second application module with a symbolic reference to the target function of the indirect function call, and a third application module to originate an indirect function call. A compiler is provided to identify potential target functions and indicate the potential target functions in the program code. A linker can read the indication the compiler made in the program code. The linker optimizes an indirect call site if the potential target functions are defined in the same module.