Patent ID: 8082421

Claim:
A program instruction rearrangement method in computer, comprising: retrieving a program to be executed by a computer from a storage device; retrieving an instruction in the program as the current instruction and retrieving a register used by the current instruction and a first action applied to the register by the current instruction; if another instruction, hereafter referred to as the second instruction, applying a second action on the same register before the first action, building a dependency between instructions of the program based register access order by the current instruction and the second instruction; calculating dependency depth of each instruction in the program; assigning the second instruction applying the second action as an upper level instruction of the current instruction; performing a calculation based on the dependency depth of an upper level instruction comprises the greatest dependency depth and assigning the result of the calculation as the dependency depth of the current instruction, thus to provide a preset difference between the dependency depths of the current instruction and the upper level instruction; and rearranging instructions in the program based on the dependency depth of each instruction thereof.