Abstract
Intermediate Representations (IRs) are central to optimizing compilers as the way the program is represented may enhance or limit analyses and transformations. Suitable IRs focus on exposing the most relevant information and establish invariants that different compiler passes can rely on. While control-flow centric IRs appear to be a natural fit for imperative programming languages, analyses required by compilers have increasingly shifted to understand data dependencies and work at multiple abstraction layers at the same time. This is partially evidenced in recent developments such as the Multi-Level Intermediate Representation (MLIR) proposed by Google. However, rigorous use of data flow centric IRs in general purpose compilers has not been evaluated for feasibility and usability as previous works provide no practical implementations.
We present the Regionalized Value State Dependence Graph (RVSDG) IR for optimizing compilers. The RVSDG is a data flow centric IR where nodes represent computations, edges represent computational dependencies, and regions capture the hierarchical structure of programs. It represents programs in demand-dependence form, implicitly supports structured control flow, and models entire programs within a single IR. We provide a complete specification of the RVSDG, construction and destruction methods, as well as exemplify its utility by presenting Dead Node and Common Node Elimination optimizations. We implemented a prototype compiler and evaluate it in terms of performance, code size, compilation time, and representational overhead. Our results indicate that the RVSDG can serve as a competitive IR in optimizing compilers while reducing complexity.
- Frances E. Allen. 1970. Control flow analysis. In ACM Sigplan Notices, Vol. 5. ACM, 1--19.Google Scholar
Digital Library
- B. Alpern, M. N. Wegman, and F. K. Zadeck. 1988. Detecting equality of variables in programs. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM, 1--11.Google Scholar
- Helge Bahmann, Nico Reissmann, Magnus Jahre, and Jan Christian Meyer. 2015. Perfect reconstructability of control flow from demand dependence graphs. ACM Transactions on Architecture and Code Optimization 11, 4 (2015), 66:1--66:25.Google Scholar
Digital Library
- W. Baxter and H. R. Bauer, III. 1989. The program dependence graph and vectorization. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM, 1--11.Google Scholar
- Philip L. Campbell, Ksheerabdhi Krishna, and Robert A. Ballance. 1993. Refining and Defining the Program Dependence Web. Technical Report. University of New Mexico.Google Scholar
- Larry Carter, Jeanne Ferrante, and Clark Thomborson. 2003. Folklore confirmed: Reducible flow graphs are exponentially larger. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages, Vol. 38. ACM, 106--114.Google Scholar
Digital Library
- Jeronimo Castrillon. 2013. Programming Heterogeneous MPSoCs: Tool Flows to Close the Software Productivity Gap. Ph.D. Dissertation. RWTH Aachen Univeristy.Google Scholar
- Jong-Deok Choi, Vivek Sarkar, and Edith Schonberg. 1996. Incremental computation of static single assignment form. In Proceedings of the International Conference on Compiler Construction. Springer-Verlag, 223--237.Google Scholar
Cross Ref
- Clang. 2017. Clang: A C Language Family Frontend for LLVM. Retrieved October 30, 2019 from https://clang.llvm.org.Google Scholar
- GNU Compiler Collection. 2018. Retrieved August 5, 2019 from https://gcc.gnu.org/.Google Scholar
- Daniel Cordes, Peter Marwedel, and Arindam Mallik. 2010. Automatic parallelization of embedded software using hierarchical task graphs and integer linear programming. In Proceedings of the ACM/IEEE International Conference on Hardware/Software Codesign and System Synthesis. 267--276.Google Scholar
Digital Library
- Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. K Zadeck. 1991. Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. Technical Report.Google Scholar
- Jack Bonnell Dennis. 1980. Data flow supercomputers. Computer 13, 11 (1980), 48--56.Google Scholar
Digital Library
- Shuhan Ding, John Earnest, and Soner Önder. 2014. Single assignment compiler, single assignment architecture: Future gated single assignment form. In Proceedings of the International Symposium on Code Generation and Optimization. ACM.Google Scholar
- Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. 1987. The program dependence graph and its use in optimization. ACM Transactions on Programming Languages and Systems 9, 3 (1987), 319--349.Google Scholar
Digital Library
- Paul Havlak. 1993. Construction of thinned gated single-assignment form. In Proceedings of the International Workshop on Languages and Compilers for Parallel Computing-Revised Papers. Springer, 477--499.Google Scholar
- S. Horwitz, J. Prins, and T. Reps. 1988. On the adequacy of program dependence graphs for representing programs. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM, 146--157.Google Scholar
- S. Horwitz, T. Reps, and D. Binkley. 1988. Interprocedural slicing using dependence graphs. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation 23, 7, 35--46.Google Scholar
Digital Library
- Neil Johnson and Alan Mycroft. 2003. Combined code motion and register allocation using the value state dependence graph. In Proceedings of the International Conference on Compiler Construction. Springer-Verlag, 1--16.Google Scholar
Cross Ref
- Neil E. Johnson. 2004. Code Size Optimization for Embedded Processors. Technical Report. University of Cambridge, Computer Laboratory.Google Scholar
- Richard Johnson, David Pearson, and Keshav Pingali. 1994. The program structure tree: Computing control regions in linear time. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 171--185.Google Scholar
Digital Library
- Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis 8 transformation. In Proceedings of the International Symposium on Code Generation and Optimization.Google Scholar
Digital Library
- Chris Lattner, Mehdi Amini, Uday Bondhugula, Albert Cohen, Andy Davis, Jacques Pienaar, River Riddle, Tatiana Shpeisman, Nicolas Vasilache, and Oleksandr Zinenko. 2020. MLIR: A Compiler Infrastructure for the End of Moore’s Law. arxiv:cs.PL/2002.11054Google Scholar
- Alan C. Lawrence. 2007. Optimizing Compilation with the Value State Dependence Graph. Technical Report. University of Cambridge.Google Scholar
- LLVM. 2018. Retrieved April 5, 2020 from https://bugs.llvm.org/show\_bug.cgi?id=31851.Google Scholar
- LLVM. 2018. Retrieved April 5, 2020 from https://bugs.llvm.org/show\_bug.cgi?id=37202.Google Scholar
- LLVM. 2018. Retrieved April 5, 2020 from https://bugs.llvm.org/show\_bug.cgi?id=31183.Google Scholar
- Naraig Manjikian and Tarek S. Abdelrahman. 1997. Fusion of loops for parallelism and locality. IEEE Transactions on Parallel and Distributed Systems 8, 2 (1997), 193--209.Google Scholar
Digital Library
- Steven S. Muchnick. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann.Google Scholar
- R. Namballa, N. Ranganathan, and A. Ejnioui. 2004. Control and data flow graph extraction for high-level synthesis. In IEEE Computer Society Annual Symposium on VLSI. 187--192.Google Scholar
- Karl J. Ottenstein, Robert A. Ballance, and Arthur B. MacCabe. 1990. The program dependence web: A representation supporting control-, data-, and demand-driven interpretation of imperative languages. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 257--271.Google Scholar
- Guilherme Ottoni, Ram Rangan, Adam Stoler, and David I. August. 2005. Automatic thread extraction with decoupled software pipelining. In Proceedings of the ACM/IEEE International Symposium on Microarchitecture. IEEE, 105--118.Google Scholar
- Louis-Noël Pouchet. 2017. Polybench/C 4.2. Retrieved November 11, 2019 from http://web.cse.ohio-state.edu/pouchet.2/software/polybench/.Google Scholar
- Nico Reißmann. 2012. Utilizing the Value State Dependence Graph for Haskell. Master of Science Thesis in Computer Science. University of Gothenburg 8 Chalmers University of Technology, Göteborg, Sweden. https://gupea.ub.gu.se/handle/2077/30117.Google Scholar
- Nico Reissmann. 2017. jlm. Retrieved April 5, 2020 from https://github.com/phate/jlm.Google Scholar
- Nico Reissmann, Thomas L. Falch, Benjamin A. Bjørnseth, Helge Bahmann, Jan Christian Meyer, and Magnus Jahre. 2016. Efficient control flow restructuring for GPUs. In Proceedings of the International Conference on High Performance Computing and Simulation. 48--57.Google Scholar
Cross Ref
- B. K. Rosen, M. N. Wegman, and F. K. Zadeck. 1988. Global value numbers and redundant computations. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM, 12--27.Google Scholar
- Radu Rugina and Martin C. Rinard. 2001. Recursion unrolling for divide and conquer programs. In Proceedings of the International Workshop on Languages and Compilers for Parallel Computing-Revised Papers. Springer-Verlag, 34--48.Google Scholar
- V. Sarkar. 1991. Automatic partitioning of a program dependence graph into parallel tasks. IBM Journal of Research and Development 35, 5-6 (1991), 779--804.Google Scholar
Digital Library
- M. Sharir. 1980. Structural analysis: A new approach to flow analysis in optimizing compilers. Computer Languages 5, 3 (1980), 141--153.Google Scholar
Digital Library
- Magnus Själander, Magnus Jahre, Gunnar Tufte, and Nico Reissmann. 2019. EPIC: An Energy-Efficient, High-Performance GPGPU Computing Research Infrastructure. arxiv:cs.DC/1912.05848Google Scholar
- James Stanier. 2012. Removing and Restoring Control Flow with the Value State Dependence Graph. Ph.D. Dissertation. University of Sussex.Google Scholar
- James Stanier and Alan Lawrence. 2011. The value state dependence graph revisited. In Proceedings of the Workshop on Intermediate Representations. 53--60.Google Scholar
- James Stanier and Des Watson. 2013. Intermediate representations in imperative compilers: A survey. Computing Surveys 45, 3 (2013).Google Scholar
Digital Library
- R. Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM Journal on Computing 1, 2 (1972), 146--160.Google Scholar
Digital Library
- Peng Tu and David Padua. 1995. Efficient building and placing of gating functions. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 47--55.Google Scholar
Digital Library
- Mark N. Wegman and F. Kenneth Zadeck. 1991. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems 13, 2 (1991), 181--210.Google Scholar
Digital Library
- Daniel Weise, Roger F. Crew, Michael Ernst, and Bjarne Steensgaard. 1994. Value dependence graphs: Representation without taxation. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM, 297--310.Google Scholar
Digital Library
- Ali Mustafa Zaidi. 2015. Accelerating Control-Flow Intensive Code in Spatial Hardware. Technical Report. University of Cambridge.Google Scholar
- Ali Mustafa Zaidi and David Greaves. 2015. Value state flow graph: A dataflow compiler IR for accelerating control-intensive code in spatial hardware. ACM Transactions on Reconfigurable Technology and Systems 9, 2 (2015), 14:1--14:22.Google Scholar
- F. Zhang and E. H. D’Hollander. 2004. Using hammock graphs to structure programs. IEEE Transactions on Software Engineering 30, 4 (2004), 231--245.Google Scholar
Digital Library
Index Terms
RVSDG: An Intermediate Representation for Optimizing Compilers
Recommendations
IRDL: an IR definition language for SSA compilers
PLDI 2022: Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and ImplementationDesigning compiler intermediate representations (IRs) is often a manual process that makes exploration and innovation in this space costly. Developers typically use general-purpose programming languages to design IRs. As a result, IR implementations are ...
Bringing low-level languages to the JVM: efficient execution of LLVM IR on Truffle
VMIL 2016: Proceedings of the 8th International Workshop on Virtual Machines and Intermediate LanguagesAlthough the Java platform has been used as a multi-language platform, most of the low-level languages (such as C, Fortran, and C++) cannot be executed efficiently on the JVM. We propose Sulong, a system that can execute LLVM-based languages on the ...
Debugging native extensions of dynamic languages
ManLang '18: Proceedings of the 15th International Conference on Managed Languages & RuntimesMany dynamic programming languages such as Ruby and Python enable developers to use so called native extensions, code implemented in typically statically compiled languages like C and C++. However, debuggers for these dynamic languages usually lack ...






Comments