Code outlining without trampolines
AssigneeOracle International Corporation
InventorsSheldon Lobo, Fu-Hwa Wang
Life of this patent
Estimating the term…
Abstract
A system and method for optimizing compiler performance including outlining cold code at link time, rather than compile time, such that trampolines are not required. Branch instructions connecting a hot block to a cold block can be converted from a short branch distance limit to a longer branch distance limit, further optimizing code performance. Editors, implementing a plurality of windows that can be maintained for each function, can display the maximum distance that code blocks can be safely outlined. Other implementations allow the optimal placement of code that is significantly greater in size than the maximum possible branch distance.
Claims15
A method of outlining code comprising:
- identifying, by a code outliner running on a computer system, cold blocks of code;
- identifying, by the code outliner running on the computer system, branch instructions that connect a hot block of code to a cold block of code;
- converting, by the code outliner running on the computer system, the branch instructions that connect the hot block of code to the cold block of code from a short branch distance to other available branch instructions that have longer branch distance spans relative to the short branch distance to thereby form a converted branch instruction;
- performing, by a linker running on the computer system at link time, an optimization including placing all cold blocks to be outlined within a branch distance of the converted branch instruction.
An apparatus of outlining code comprising:
- means for identifying cold blocks of code;
- means for identifying branch instructions that connect a hot block of code to a cold block of code;
- means for converting the branch instructions that connect the hot block of code to the cold block of code from a short branch distance to other available branch instructions that have longer branch distance spans relative to the short branch distance to thereby form a converted branch instruction;
- means for performing an optimization at link time, the optimization including placing all cold blocks to be outlined within a branch distance of the converted branch instruction.
A code outliner comprising:
- a cold block module running on a computer system, the cold block module identifying cold blocks of code;
- a control transfer identification module running on the computer system, the control transfer identification module identifying branch instructions that connect a hot block of code to a cold block of code;
- a conversion module running on the computer system, the conversion module converting the branch instructions that connect the hot block of code to the cold block of code from a short branch distance to other available branch instructions that have longer branch distance spans relative to the short branch distance to thereby form a converted branch instruction;
- and,
- an optimizer module running on the computer system, the optimizer module placing all cold blocks to be outlined within a branch distance of the converted branch instruction.
Dependencies are inferred from the claim text.