US 7,574,704 B2
System and method for frequency based loop reorganization
Mike Stephen Fulton, Maple Ridge (Canada); Christopher B. Larsson, Hurley, N.Y. (US); and Vijay Sundaresan, North York (Canada)
Assigned to International Business Machines Corporation, Armonk, N.Y. (US)
Filed on Oct. 21, 2004, as Appl. No. 10/970,436.
Prior Publication US 2006/0101441 A1, May 11, 2006
Int. Cl. G06F 9/44 (2006.01); G06F 9/45 (2006.01)
U.S. Cl. 717—159  [717/128; 717/140; 717/150; 717/151; 717/158] 20 Claims
OG exemplary drawing
 
1. A method, in a data processing system, for reorganizing computer code so as to prepare the computer code for application of optimization techniques, comprising:
identifying a portion of the computer code that matches a coding style of interest, wherein the coding style of interest is one or more instruction loops that have a high frequency of execution and also have frequently executed blocks of instructions and rarely executed blocks of instructions;
identifying one or more of the frequently executed blocks of instructions and one or more of the rarely executed blocks of instructions within the one or more instruction loops that have a high frequency of execution;
removing the one or more of the rarely executed blocks of instructions from the portion of computer code; and
appending the one or more of the rarely executed blocks of instructions to an end of the one or more instruction loops with a reference back to a beginning of the one or more instruction loops, wherein the one or more of the frequently executed blocks of instructions is maintained at the beginning of the one or more instruction loops to thereby generate reorganized computer code.