Profile driven optimization of frequently executed paths with inlining of code fragment (one or more lines of code from a child procedure to a parent procedure)
AssigneeInternational Business Machines Corporation
InventorsRobert John Donovan, Robert Ralph Roediger, William Jon Schmidt
Life of this patent
Estimating the term…
Abstract
A compiler and method of compiling provide enhanced performance by inlining one or more frequently executed paths through a child procedure into a parent procedure without inlining the entire child procedure. Accordingly, a substantial improvement in speed of execution of the program can be achieved by reducing procedure call overhead, with reduced expense in terms of program size as compared to traditional inlining. Various criteria for determining whether to inline particular child procedures are also described.
Claims26
A method for optimizing a computer program including a child procedure and a parent procedure which includes one or more statements that invoke the child procedure, comprising
- selecting one or more paths through the child procedure, the one or more paths including fewer than all of the paths through the child procedure, and
- inlining the one or more paths from the child procedure of said computer program into the parent procedure, in place of the one or more statements that invoke the child procedure without inlining into the parent procedure at least one reachable path through the child procedure that can be traversed upon invocation of the child procedure via the parent procedure.
A computer system for compiling a computer program including a child procedure and a parent procedure which includes one or more statements that invoke the child procedure, into a machine-readable representation, the computer system comprising:
- (a) an optimizer that optimizes the computer procedure into an optimized representation, the optimizer selecting one or more paths through the child procedure, the one or more paths including fewer than all of the paths through the child procedure, and inlining the one or more paths from the child procedure of said computer program into the parent procedure, in place of the one or more statements that invoke the child procedure without inlining into the parent procedure at least one reachable path through the child procedure that can be traversed upon invocation of the child procedure via the parent procedure;
- and
- (b) a machine-readable code generator that generates a machine-readable representation of the computer procedure from the optimized representation.
A program product, comprising:
- (a) a program configured to optimize a computer program including a child procedure and a parent procedure which includes one or more statements that invoke the child procedure, by
- selecting one or more paths through the child procedure, the one or more paths including fewer than all of the paths through the child procedure,
- inlining the one or more paths from the child procedure of said computer program into the parent procedure, in place of the one or more statements that invoke the child procedure without inlining into the parent procedure at least one reachable path through the child procedure that can be traversed upon invocation of the child procedure via the parent procedure;
- and
- (b) a signal bearing media bearing the program.
Dependencies are inferred from the claim text.