Transformation of a loop within computer code to minimize iterations
AssigneeInternational Business Machines Corporation
InventorsWai Hung Tsang, Ettore Tiotto, Bardia Mahjour
Life of this patent
Estimating the term…
Abstract
A loop within computer code is transformed to minimize loop iterations. A determination is made using statistical information relating to the loop whether the loop that has an early exit indication is to be transformed to minimize iterations of the loop. Based on determining that the loop is to be transformed, the loop is transformed.
Claims20
A computer program product for facilitating processing within a computing environment, the computer program product comprising:
- one or more computer readable storage media and program instructions collectively stored on the one or more computer readable storage media to perform a method comprising:
- translating, using a compiler executing on a processor of the computing environment, source code of a computer program to machine code, the machine code including a loop that has an early exit indication, wherein the loop is terminated prior to a last iteration of the loop;
- determining, by the compiler, using statistical information relating to the loop that has the early exit indication that the loop is to be transformed to minimize iterations of the loop to reach the early exit indication;
- transforming the loop, by the compiler, based on determining that the loop is to be transformed, wherein the transforming the loop generates a transformed loop and wherein the transforming the loop changes how the transformed loop iterates such that the early exit indication in the transformed loop is reached in fewer iterations compared to the early exit indication in the loop prior to transformation;
- and
- executing the machine code to perform a task of the computer program.
A computer system for facilitating processing within a computing environment, the computer system comprising:
- a memory;
- and
- at least one processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
- translating, using a compiler executing on a processor of the computing environment, source code of a computer program to machine code, the machine code including a loop that has an early exit indication, wherein the loop is terminated prior to a last iteration of the loop;
- determining, by the compiler, using statistical information relating to the loop that has the early exit indication that the loop is to be transformed to minimize iterations of the loop to reach the early exit indication;
- transforming the loop, by the compiler, based on determining that the loop is to be transformed, wherein the transforming the loop generates a transformed loop and wherein the transforming the loop changes how the transformed loop iterates such that the early exit indication in the transformed loop is reached in fewer iterations compared to the early exit indication in the loop prior to transformation;
- and
- executing the machine code to perform a task of the computer program.
A computer-implemented method of facilitating processing within a computing environment, the computer-implemented method comprising:
- translating, using a compiler executing on a processor of the computing environment, source code of a computer program to machine code, the machine code including a loop that has an early exit indication, wherein the loop is terminated prior to a last iteration of the loop;
- determining, by the compiler, using statistical information relating to the loop that has the early exit indication that the loop is to be transformed to minimize iterations of the loop to reach the early exit indication;
- transforming the loop, by the compiler, based on determining that the loop is to be transformed, wherein the transforming the loop generates a transformed loop and wherein the transforming the loop changes how the transformed loop iterates such that the early exit indication in the transformed loop is reached in fewer iterations compared to the early exit indication in the loop prior to being transformed;
- and
- executing the machine code to perform a task of the computer program.
Dependencies are inferred from the claim text.