Unrolling transformation of nested loops
First Claim
1. A method for unrolling loops in a loop nest, said loop nest iterating over an actual iteration space of n-dimension, said method comprising:
- accounting for residues, said residues comprising portions of said actual iteration space falling outside of, or incompletely overlapping with, cuts of a virtual iteration space, said virtual iteration space comprising said actual iteration space and said virtual iteration space evenly divided by an unrolling factor, said cuts and said virtual iteration space having n-dimensions;
unrolling at least one outer loop of said loop nest, said unrolled outer loop bounded by cuts of said virtual iteration space falling completely within said actual iteration space.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention is directed to a transformation technique for nested loops. A virtual iteration space may be determined based on an unroll factor (UF). The virtual iteration space, which includes the actual iteration space, is formed such that, the virtual iteration space may be evenly divided by a selected UF. Once the virtual iteration space has been calculated or determined, the virtual iteration space is “cut” into regular portions by one or more unroll factors. Portions of the actual iteration space which do not fill the cut portions of the virtual iteration space or which fall outside these cuts which have been evenly divided by the unroll factor form a residue which is calculated. The portions of the actual iteration space which remain are also evenly divided by the unroll factor(s). An outer loop for this remaining portion of the actual iteration space is then unrolled. This unrolled portion forms a perfect nested loop. Accordingly, the operations for the unrolled remaining portion of the actual iteration space when combined with the operations for the residue of the actual iteration space which was not evenly divided by the unroll factor is, in appropriate situations, semantically equivalent to the original nested loops. Aspects of the invention are applicable to rectangular and triangular loop nests, and combinations thereof. Moreover, the invention is applicable to loops having n-dimensions.
-
Citations
46 Claims
-
1. A method for unrolling loops in a loop nest, said loop nest iterating over an actual iteration space of n-dimension, said method comprising:
-
accounting for residues, said residues comprising portions of said actual iteration space falling outside of, or incompletely overlapping with, cuts of a virtual iteration space, said virtual iteration space comprising said actual iteration space and said virtual iteration space evenly divided by an unrolling factor, said cuts and said virtual iteration space having n-dimensions;
unrolling at least one outer loop of said loop nest, said unrolled outer loop bounded by cuts of said virtual iteration space falling completely within said actual iteration space. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A computer readable media storing data and instructions, said data and instructions, when executed, adapting a computer system to unroll loops in a loop nest, said nested loop nest iterating over an actual iteration space of n-dimension, said computer system adapted to:
-
account for residues, said residues comprising portions of said actual iteration space falling outside of, or incompletely overlapping with, cuts of a virtual iteration space, said virtual iteration space comprising said actual iteration space and said virtual iteration space evenly divided by an unrolling factor, said cuts and said virtual iteration space having n-dimensions;
unroll at least one outer loop of said nested loop nest, said unrolled outer loop bounded by cutsslices of said virtual iteration space falling completely within said actual iteration space. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
-
-
27. A method for unrolling loops in a loop nest, said nested loop nest iterating over an actual iteration space of n-dimension, said method comprising:
-
means accounting for residues, said residues comprising portions of said actual iteration space falling outside of, or incompletely overlapping with, cuts of a virtual iteration space, said virtual iteration space comprising said actual iteration space and said virtual iteration space evenly divided by an unrolling factor, said cuts and said virtual iteration space having n-dimensions;
means unrolling at least one outer loop of said nested loop nest, said unrolled outer loop bounded by cutsslices of said virtual iteration space falling completely within said actual iteration space. - View Dependent Claims (28, 29, 30, 31, 32, 33, 34)
-
-
35. A compiled file corresponding to a source code file, said source code file comprising a nested loop nest iterating over an actual iteration space of n-dimension, said compiled file comprising machine readable instructions corresponding to said nested loop, said machine readable instructions comprising:
-
machine readable instructions accounting for residues, said residues comprising portions of said actual iteration space falling outside of, or incompletely overlapping with, cuts of a virtual iteration space, said virtual iteration space comprising said actual iteration space and said virtual iteration space evenly divided by an unrolling factor, said cuts and said virtual iteration space having n-dimensions;
machine readable instructions unrolling at least one outer loop of said loop nest, said unrolled outer loop bounded by cuts of said virtual iteration space falling completely within said actual iteration space. - View Dependent Claims (36, 37, 38, 39, 40, 43, 44, 45, 46)
-
- 41. The compiled file of claim 41 wherein said virtual iteration space is bounded by the modulus of an upper bound of the induction variable of said outer loop and said unrolling factor.
Specification