Cross-file inlining by using summaries and global worklist
AssigneeHewlett-Packard Development Company, L.P.
InventorsDhruva Chakrabarti, Shin-Ming Liu
Life of this patent
Estimating the term…
Loading patent…
AssigneeHewlett-Packard Development Company, L.P.
InventorsDhruva Chakrabarti, Shin-Ming Liu
Estimating the term…
One embodiment disclosed relates to a method of compiling a computer program. A plurality of modules of source code is received, and intermediate representations corresponding to the modules are generated. A set of data from the intermediate representations is extracted to create an inliner summary for each module. Using the inliner summaries and a globally-sorted working-list based order, an inline analysis phase determines which call sites in the modules are to be inlined by substituting code from a called module. The propagation of summaries may be done elaborately, potentially throughout the call-graph. The goodness of call sites may be computed with a view to comparing them and ordering them in a descending order of goodness. Applicants believe the compile-time effectiveness lies in the ability to work consistently with summary information in the inline analysis phase without having to touch the intermediate representation, while maintaining a high degree of run-time performance by continuously updating the summary information.
A method of compiling a computer program, the method comprising:
The method of claim 4, wherein updating the inliner summaries comprises determining nodes and edges of the call graph that are affected by the inlining of the call site and updating those inliner summaries corresponding to the affected nodes and edges.
The method of claim 5, wherein the edge summaries include at least a call site execution count and a signature type.
An apparatus for compiling a computer program, the apparatus comprising:
The apparatus of claim 9, wherein the cross-module optimizer is further configured to update a call graph of the routines (nodes) and call sites (edges), and updates the inliner summaries, after a call site is determined to be inlined.
The apparatus of claim 10, wherein the cross-module optimizer is further configured to re-calculate profitabilities associated with remaining call sites, and re-order the working list using the re-calculated profitabilities, after the call graph and inliner summaries are updated.
The apparatus of claim 12, wherein the cross-module optimizer is further configured to update the inliner summaries by determining nodes and edges of the call graph that are affected by the inlining of the call site and update those inliner summaries corresponding to the affected nodes and edges.
The apparatus of claim 13, wherein the edge summaries generated by the front-end portion include at least a call site execution count and a signature type.
The apparatus of claim 13, wherein the node summaries generated by the front-end portion include at least a code size, a routine execution count, and a call-graph height.
A computer program product comprising a computer-usable medium having computer-readable code embodied therein, the computer program product being compiled from a plurality of modules of source code using inliner summaries and a globally-sorted working-list based order in an inline analysis phase to determine which call sites in the modules are to be inlined by substituting code from a called module.
Dependencies are inferred from the claim text.