Patent ID: 7120907

Claim:
A method for optimizing a loop in an instruction stream of a computer program, the method comprising the steps of: identifying a partial hot trace using profile data; identifying an augmented hot trace set of instructions comprising a proper superset of the partial hot trace, but comprising a proper subset of the entire loop, and which forms a complete loop iteration; optimizing the loop in the instruction stream of the computer program by unrolling the augmented hot trace set of instructions without unrolling the entire loop; identifying an augmentation path set using the profile data; combining the augmentation path set with the partial hot trace to form the augmented hot trace set of instructions; and the step of identifying an augmentation path set using the profile data further comprising the step of: identifying a candidate augmentation path set of instructions having more than one trace through the candidate augmentation path set of instructions, and more than one of the traces having similar probabilities of being executed during an iteration of the loop, the sum of the probabilities of the one or more traces through the set being similar to the probability of execution of the partial hot trace.