Abstract
Recognizing and transforming loops are essential steps in any attempt to improve the running time of a program. Aggressive restructuring techniques have been developed for single-entry (reducible) loops, but restructurers and the dataflow and dependence analysis they rely on often give up in the presence of multientry (irreducible) loops. Thus one irreducible loop can prevent the improvement of all loops in a procedure. This article give an algorithm to build a loop nesting tree for a procedure with arbitrary control flow. The algorithm uses definitions of reducible and irreducible loops which allow either kind of loop to be nested in the other. The tree construction algorithm, an extension of Tarjan's algorithm for testing reducibility, runs in almost linear time. In the presence of irreducible loops, the loop nesting tree can depend on the depth-first spanning tree used to build it. In particular, the header node representing a reducible loop in one version of the loop nesting tree can be the representative of an irreducible loop in another. We give a normalization method that maximizes the set of reducible loops discovered, independent of the depth-first spanning tree used. The normalization require the insertion of at most one node and one edge per reducible loop.
Publisher
Association for Computing Machinery (ACM)
Reference6 articles.
1. AHO A. V. SETHI R. I. AND ULLMAN J. m. 1986. Compilers: Principles Techniques and Tools 2rid ed. Addison-Wesley Reading Mass. AHO A. V. SETHI R. I. AND ULLMAN J. m. 1986. Compilers: Principles Techniques and Tools 2rid ed. Addison-Wesley Reading Mass.
2. An interval-based approach to exhaustive and incremental interprocedural data-flow analysis
3. A fast algorithm for finding dominators in a flowgraph
4. SCHWARTZ J. AND SHARIR M. 1979. A design for optimizations of the bitvectoring class. Tech. rep. Courant Inst. New York Univ. New York. September. SCHWARTZ J. AND SHARIR M. 1979. A design for optimizations of the bitvectoring class. Tech. rep. Courant Inst. New York Univ. New York. September.
5. Testing flow graph reducibility;TARJAN R. E.;J. Comput. Syst. Sc{.,1974
Cited by
71 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. AugPersist: Automatically augmenting the persistence of coverage-based greybox fuzzing for persistent software;Computers & Security;2025-01
2. Misconceptions about Loops in C;Proceedings of the 13th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis;2024-06-20
3. Reducing the Overhead of Exact Profiling by Reusing Affine Variables;Proceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction;2024-02-17
4. Bringing Compiling Databases to RISC Architectures;Proceedings of the VLDB Endowment;2023-02
5. Understanding and Decomposing Control-Flow Loops in Business Process Models;Lecture Notes in Computer Science;2022