Patent ID: 6993757

Claim:
A method for multi-versioning loops in a computer program to facilitate modulo scheduling, comprising: receiving the computer program; locating a loop within the computer program; examining a termination condition for the loop; if the loop termination condition is based on a “not-equal-to” condition that makes it hard to determine beforehand whether the loop will terminate and consequently makes it hard to modulo schedule the loop, creating multiple versions of the loop, one of which might be an infinite loop and consequently cannot be modulo scheduled, and at least one of which is a non-infinite loop which can be modulo scheduled; wherein creating multiple versions of the loop involves creating a version of the loop by modifying the loop termination condition to be a “greater-than” condition or to be a “less-than” condition, whereby the resulting loop can be modulo scheduled; and executing the computer program on a computer.