Sibling Caller Marking for External Call Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current computing environments restrict sibling calls to local callees, limiting performance optimizations due to the inability to determine whether a call is local or external, leading to incorrect context restoration and inefficient code generation.
Innovation Solution
A method is introduced to mark routines as potential sibling callers using pseudo-instructions and relocation entries, allowing the linker to generate optimized call sequences that store and restore context information appropriately for both local and external sibling calls.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the compiler generates sibling calls only to local callees, then the code generation is simple and fast, but the performance optimization opportunity is lost for external sibling calls
Solution Approach 1:
The compiler performs preliminary marking of routines as potential sibling callers during compilation, even when the call target (local or external) is not yet determined. This preliminary action allows the linker to later generate appropriate optimized call sequences based on the marking information, enabling sibling call optimization for external calls while maintaining simple compilation.
2Reliability
If the compiler does not mark routines as sibling callers, then the linker cannot perform context restoration for external sibling calls, but marking all routines increases code complexity
Solution Approach 1:
Instead of marking all routines uniformly, the compiler applies marking selectively only to routines that potentially call sibling routines. This localized marking approach ensures context restoration correctness for external sibling calls while minimizing the addition of pseudo-instructions and maintaining code structure simplicity for routines that do not require optimization.
3Ease of operation
If stack frames are allocated for every call, then context restoration is simplified, but unnecessary stack operations reduce processing performance
Solution Approach 1:
The system dynamically determines whether to allocate stack frames based on the sibling caller marking and call type. For local sibling calls, no stack frame is allocated since the caller is guaranteed to be the return target. For external sibling calls, stack frames are allocated to enable proper context restoration. This dynamic approach eliminates unnecessary stack operations while maintaining correct context restoration.
Data Source
AI summary
Optimizations are provided for sibling calls. A sibling caller is marked to indicate that it may call a sibling routine or that it may call an external sibling routine. Based on the marking, certain processing is performed to facilitate use of sibling calls, particularly when the sibling routine being called is external to the caller.


