Loop branch reduction
Abstract:
A method for reducing loop branches comprises analyzing an intermediate code to identify a candidate loop; analyzing the candidate loop to identify a candidate conditional statement containing at least one mutable operand; and determining if the computation in the candidate conditional statement is monotonic. The method further comprises calculating initial and final values of the mutable operand and generating a first version of the candidate loop which does not contain the candidate conditional statement and which is configured to be executed if the initial and final values of the mutable operand satisfy a range check. The method also comprises generating a second version of the candidate loop which contains the candidate conditional statement and which is configured to be executed if at least one of the initial and final values of the mutable operand does not satisfy the range check.
Information query
Patent Agency Ranking
0/0