Patent ID: 6594824
Filing Date: 2003-07-15
Classification: G06F,Y10S

Abstract:
A method of generating an optimized intermediate representation (IR) of source code for a computer program from an initial IR, both the initial and optimized IRs comprising a plurality of basic blocks, each of which comprises at least one instruction, the method comprising the steps of:(a) ordering the basic blocks of the initial IR according to an estimated profit value assigned to each basic block, wherein the estimated profit value is related to a repetition counter assigned to each instruction in the initial IR, the repetition counter being an estimate of the number of times its instruction is performed during execution of the computer program according to the initial IR; (b) calculating a goal function that measures the degree of optimization of the computer program according to its initial IR; and (c) iteratively testing the effect on the goal function of modifying the IR by moving an instruction from one of the basic blocks to each predecessor of that basic block, adopting the modified IR if the effect is a reduction of the goal function, until the modified IR converges.