Method for unrolling two-deep loops with convex bounds and imperfectly nested code, and for unrolling arbitrarily deep nests with constant bounds and imperfectly nested code
Abstract
A compiler for compiling source code whereby the compiled source code is optimized by performing outer loop unrolling (a generalization of "unroll and jam" on selected loop nests. The present invention allows any arbitrarily deep loop nests with non-varying loop bounds to be properly unrolled even in the presence of imperfectly nested code. This is accomplished for two-deep loop nests by transforming the code into multiple adjacent loop nests. In the transformed code, the imperfect code is isolated so that one of the adjacent loops nests has none, and thus can be unrolled and jammed. For three-deep or greater loop nests, the process is repeated recursively from the outer-most loop. The present invention also allows outer loop unrolling for two-deep loop nests with convex bounds, even with the presence of imperfectly nested code. This is accomplished by identifying strips of code which do not contain imperfectly nested code. An unroll and jam operation is executed for the identified strips. Code falling outside of the identified strips as well as wind-down code, are executed according to their original, untransformed order.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 19 · Forward citations: 31.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
In a compiler for optimizing source code, a method for unrolling a two-deep loop nest of source code having constant bounds and imperfectly nested code, comprising the steps of: transforming the two-deep loop nest into adjacent two-deep loop nests comprising a first two-deep loop nest, a second two-deep loop nest and a third two-deep loop nest, wherein said first two-deep loop nest handles the imperfectly nested code above an inner loop, said second two-deep loop nest contains only perfectly nested code, and wherein said third two-deep nest handles imperfectly nested code below said inner loop
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (15 of 31 total)
References Cited — Backward Prior Art (19)
Non-Patent Literature (5)
- Carr et al, "Improving Software Pipelining With Unroll-and-Jam," Proceedings of the Twenty-Ninth Hawaii International Conference on System Sciences, vol. 1, pp. 183-192, Jan. 1996.*
- Carter, L. et al., "Hierarchical Tiling for Improved Superscalar Performance," IEEE, Apr. 1995, pp. 239-245.
- Lam, M. et al., "The Cache Performance and Optimizations of Blocked Algorithms," Fourth International Conference on Architectural Support for Programming Languages and Operating Systems, Apr. 8-11, 1991, pp. 63-74.
- Punyamurtula, S. and Chaudhary, V., "Minimum Dependence Distance Tiling of Nested Loops with Non-uniform Dependences," Proceedings of the Sixth IEEE Symposium on Parallel and Distributed Processing, IEEE, Oct. 26-29, 1994, Dallas, Texas, pp. 74-81.
- Torrellas, J. et al., "Optimizing Instruction Cache Performance for Operating System Intensive Workloads," Proceedings of the First IEEE Symposium on High-Performance Computer Architecture, IEEE, Jan. 22-25, 1995, pp. 360-369.