Patent ID: 6988266

Claim:
A method executed in a computer system for processing software source code with a variable looping statement having a loop index, an initial expression, an exit expression and a body, wherein at least one of the initial and exit expressions depends on a variable other than the loop index, to enable loop unrolling, comprising: determining from the initial expression and the exit expression, a constant upper bound; determining from the initial expression and the exit expression, a constant lower bound; determining a condition that must be satisfied, said condition reflecting any conditions within the initial expression and the exit expression; and replacing the variable looping statement in the software source code with a constant looping statement, wherein said upper bound and said lower bound define a range of values for a loop index within said constant looping statement, wherein said constant looping statement includes a nested conditional statement which tests said determined condition, wherein a body of said constant looping statement comprises the body of said variable looping statement, and wherein said body of said constant looping statement is only executed in the event that said determined condition is satisfied.