Patent ID: 6195793
Filing Date: 2001-02-27
Classification: G06F

Abstract:
A computer implemented compiler method for implementing adaptive inlining for compiler optimization and improving program execution in a computer system comprising the steps of:identifying call sites in a call multigraph for possible inlining;identifying a first approximation of initial call sites of said identified possible call sites for inlining based upon call frequency and called procedure size including the steps of; utilizing a call multigraph consisting of N nodes and E edges; where each node represents a procedure in the module, and each arc AB represents a call site in a procedure A that may invoke a procedure B; an array initialSize containing estimated instruction counts for each procedure 1-N;calculating a total initial sum of the array initialSize;calculating a bloat budget equal to said total initial sum multiplied by a set bloat factor; andfor each arc 1 to E,checking for an illegal or undesirable inlining candidate,responsive to identifying an illegal or undesirable inlining candidate, setting a priority for the arc to infinity,responsive to not identifying an illegal or undesirable inlining candidate, calculating a bloat estimate and a priority for the arc, andall finite priority arcs being placed in said initial priority queue, keyed by smallest priority;processing procedures in said call multigraph in a determined order where a first procedure is only processed after all second procedures called by said first procedure are processed; said processing of said first procedure comprising the steps of:determining whether any call site within said first procedure has been selected for inlining, and whether the second procedure called from the call site contains confirmed inlined call sites; andif true, determining whether to confirm or reject the first approximation to inline the second procedure into said first procedure at the call site utilizing at least one predetermined criterion.