Lazy Code Motion. Jens Knoop FernUniversität Hagen. Oliver Rüthing University of Dortmund. Bernhard Steffen University of Dortmund

Size: px
Start display at page:

Download "Lazy Code Motion. Jens Knoop FernUniversität Hagen. Oliver Rüthing University of Dortmund. Bernhard Steffen University of Dortmund"

Transcription

1 RETROSPECTIVE: Lazy Code Motion Jens Knoop FernUniversität Hagen Oliver Rüthing University of Dortmund Bernhard Steffen University of Dortmund 1. CODE MOTION THE HISTORY Compiler techniques for eliminating redundant computations or moving invariant code out of loops have been known and widely been used since the early seventies [4]. In 1979, Morel and Renvoise came up with an exciting new technique, the suppression of partial redundancies [20]. Their technique uniformly subsumed loop invariant code motion, common subexpression elimination, and the elimination of redundant computations. Probably, the most appealing facet of their technique was its structural purity: the transformation was solely based on data-flow analysis and did not require any specific knowledge on the control flow of the programs under investigation. On the other hand, their genuine proposal was conceptually complex. It involved an equation system of four highly interacting global properties while still suffering from three deficiencies. First, too few partial redundancies are removed. Intuitively, this was due to Morel s and Renvoise s design decision to insert code at the nodes of the underlying flow graph rather than at its edges, which unnecessarily restricted the possible computation points. Second, code was moved too far, which led to unnecessary register pressure. And third, the node placement was based on bidirectional data-flow equations which from a conceptual point of view are difficult to comprehend and from a computational point of view are more costly to compute. Up to the early nineties a number of modifications to the Morel-Renvoise algorithm had been proposed in order to address these deficiencies [2, 5]. While the first deficiency could be resolved by means of edge placement techniques, bidirectionality and register pressure were only partially addressed by means of heuristics. 2. LCM OUR CONTRIBUTION As we started our work on lazy code motion, we were convinced that research efforts based on modifying the Morel/- Renvoise-style equations had led into a dead end. Partial redundancy elimination (PRE) is a beautiful technique with a simple underlying basic idea: expressions are hoisted to earlier program points increasing thereby their potential to make the original ones fully redundant, which can then be eliminated. We had the strong belief that it must be possible to construct a PRE-technique which is solely composed out of simple and well-understood components. Decomposing the problem. A key idea to attack the prob- 20 Years of the ACM/SIGPLAN Conference on Programming Language Design and Implementation ( ): A Selection, Copyright 2003 ACM $5.00. lem was its decomposition based on a clean separation of concerns. We noticed that there are two optimization goals with a natural hierachy: the primary is to reduce the number of computations to a minimum (computational optimality); the secondary to avoid unnecessary code movement to minimize the lifetimes of temporaries and hence the register pressure (lifetime optimality). Solving the problem. Fortunately, we already had an offthe-shelf solution for the first optimization goal. Investigating the relationship between model checking and data-flow analysis has led to a modal logic specification of a computationally optimal PRE following an as-early-as-possible code placement strategy [27]. We called the resulting transformation Busy Code Motion (BCM), as it hoists code as far as possible. Technically it required only two simple unidirectional data-flow analyses. This simplicity revealed the solution to our secondary goal, the avoidance of unnecessary code motion: the code only had to sink back from the BCM insertion points as far as computational optimality was preserved, which can be realized simply by adding another unidirectional data-flow analysis. The resulting transformation, which solves the problem of unnecessary register pressure, hoists code just far enough to ensure computationally optimal results, the reason for it being called Lazy Code Motion (LCM). This successful way of playing with simple analysis components was later extended to also control/minimize code size [26]. Here, the natural trade-off between the optimization goals led to different solutions depending on the chosen priority between size and speed. 3. THE IMPACT How to figure out and measure the impact of a paper? As a first indication, a zeitgeisty approach for tracking this down might be to consult some pertinent Internet search engines. Doing so for the phrase lazy code motion, a Google search yields around 670 results, Scirus comes up with about 235 Web references, and CiteSeer with around 75 citations of both the PLDI 92 paper on LCM and its 1994 TOPLAS journal version, all this in October Of course, not all of the links resulting from these searches are truly or meaningfully related to LCM. Following some of the remaining ones, this suggests that the PLDI 1992 paper on LCM is going to have some impact on both teaching, research, and industrial practice. To give a few examples, LCM is subject to class assignments (UC Berkeley), considered in courses entitled such as on classic and maybe-will-be classic compiler papers (Rice), ACM SIGPLAN 460 Best of PLDI

2 and part of the body of knowledge for qualifying examinations in the area of programming languages and compilers (Georgia Tech). LCM has been incorporated in recent textbooks on compiler construction such as the ones of Muchnick [22] and Morgan [21]. Browsing the PLDI proceedings of 1993 through 2002, there are 18 papers citing the PLDI 1992 paper or its TOPLAS version. Most notable are the PLDI 1997 and 1998 papers of Chow, Kennedy et al. In [3, 19] they develop SSA-based algorithms for PRE and register promotion based on the LCM idea, which influenced the PRE-implementations in several commercial and academic compilers. Examples are production compilers such as the Sun SPARCompiler language systems, SGI s and Intel s IA- 64 compilers, and IBM s JIT compiler. Furthermore, LCM impacted the PRE-optimization in open-source compilers such as the GNU-compilers, and the Open Research Compiler (ORC), a descendant of SGI s Pro64 compiler, which was recently released by Intel to the open source community. Similarly, LCM influenced research compiler projects such as SUIF, Soot, and the CoSy compilation system. In the meantime, the latter also turned into a commercial product. Besides immediate adaptations [6, 23], LCM also stipulated research in other areas. In varying degrees, it influenced the development of profile-based refinements of PRE [8], the development of techniques for register promotion [19, 1] and array bounds checks elimination [18], as well as of extensions to other optimization goals such as constant propagation and strength reduction [7, 9] to cite a few. As indicated above, LCM also broadly influenced our own research. Its structural clarity paved the way to systematically extend PRE to different settings and paradigms such as the interprocedural, explicitly parallel, and predicated one [10, 17, 11], and it provided the key to develop related techniques such as lazy strength reduction, partial dead-code elimination, and assignment motion [16, 14, 15], as well as to the redesign of previous algorithms for global value numbering [13]. Moreover, it opened the gate to new applications such as communication optimization in data-parallel languages [12], and to thoroughly investigating the impact of interdependent program transformations [24], and of the interdependencies of bidirectionality and critical edges in PRE [25]. For a detailed account of PRE see Last but not least, the LCM paper won the Most Influencial PLDI Paper Award 2002 (for 1992). Acknowledgements We would like to thank Hans Boehm, Michael Burke, Sun C. Chan, Fred Chow, Jim Dehnert, Michael Hind, Roy Ju, Robert Kennedy, Jim Larus, Shin-Ming Liu, and Peng Tu for sharing their knowledge on the impact of LCM to related techniques and their usage in commercial compilers with us. REFERENCES [1] R. Bodík, R. Gupta, and M. L. Soffa. Load-reuse analysis: Design and evaluation. In Proc. ACM SIGPLAN PLDI 99, ACM SIGPLAN Not., 34(5):64-76, [2] F. Chow. A Portable Machine Independent Optimizer Design and Measurements. PhD thesis, Stanford Univ., Dept. of Electrical Eng., Stanford, CA, [3] F. Chow, S. Chan, R. Kennedy, S. Liu, R. Lo, and P. Tu. A new algorithm for partial redundancy elimination based on SSA form. In Proc. ACM SIGPLAN PLDI 97, ACM SIGPLAN Not., 32(5): , [4] J. Cocke and J. T. Schwartz. Programming languages and their compilers. Courant Inst. Math. Sciences, NY, [5] D. M. Dhamdhere. Practical adaptation of the global optimization algorithm of Morel and Renvoise. ACM Trans. Prog. Lang. Syst., 13(2): , Tech. Corr. [6] K.-H. Drechsler and M. P. Stadel. A variation of Knoop, Rüthingand Steffen s LAZY CODE MOTION. ACM SIGPLAN Not., 28(5):29 38, [7] M. Hailperin. Cost-optimal code motion. ACM Trans. Prog. Lang. Syst., 20(6): , [8] R. N. Horspool and H. C. Ho. Partial redundancy elimination driven by a cost-benefit analysis. In Proc. 8th Israeli Conf. on Computer Systems and Software Engineering (ICSSE 97), pages , [9] R. Kennedy, F. Chow, P. Dahl, S.-M. Liu, R. Lo, and M. Streich. Strength reduction via SSAPRE. In Proc. 7th Conf. Comp. Construction (CC 98), LNCS 1383, , [10] J. Knoop. Optimal Interprocedural Program Optimization: A new Framework and its Application. LNCS Tutorial 1428, Springer-V., [11] J. Knoop, J.-F. Collard, and R. D. Ju. Partial redundancy elimination on predicated code. In Proc. 7th Static Analysis Symp. (SAS 2000), LNCS 1824, , [12] J. Knoop and E. Mehofer. Distribution assignment placement: Effective optimization of redistribution costs. IEEE Trans. Parallel and Distributed Systems (TPDS), 13(6): , [13] J. Knoop, O. Rüthing, and B. Steffen. Code motion and code placement: Just synomyms? In Proc. 7th European Symp. on Prog. (ESOP 98), LNCS 1381, , [14] J. Knoop, O. Rüthing, and B. Steffen. Partial dead code elimination. In Proc. ACM SIGPLAN PLDI 94, ACM SIGPLAN Not., 29(6): , [15] J. Knoop, O. Rüthing, and B. Steffen. The power of assignment motion. In Proc. ACM SIGPLAN PLDI 95, ACM SIGPLAN Not., 30(6): , [16] J. Knoop, O. Rüthing, and B. Steffen. Lazy strength reduction. J. Prog. Lang., 1(1):71 91, [17] J. Knoop and B. Steffen. Code motion for explicitly parallel programs. In Proc. 7th ACM SIGPLAN Symp. on Principles and Practice of Parallel Programming (PPoPP 99), ACM SIGPLAN Not., 34(8):13-24, [18] P. Kolte and M. Wolfe. Elimination of redundant array subscript range checks. In Proc. ACM SIGPLAN PLDI 95, ACM SIGPLAN Not., 30(6): , [19] R. Lo, F. C. Chow, R. Kennedy, S. M. Liu, and P. Tu. Register promotion by sparse partial redundancy elimination of loads and stores. In Proc. ACM SIGPLAN PLDI 98, ACM SIGPLAN Not., 33(5):26-37, [20] E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Comm. ACM, 22(2):96 103, [21] R. Morgan. Building an Optimizing Compiler. Digital Press, [22] S. S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, [23] V.K.Paleri,Y.N.Srikant,andP.Shankar.Asimple algorithm for partial redundancy elimination. ACM SIGPLAN Not., 33(12):35 43, [24] O. Rüthing. Interacting Code Motion Transformations: Their Impact and Their Complexity. LNCS Springer-V., [25] O. Rüthing. Code motion in the presence of critical edges without bidirectional data flow analysis. Science of Computer Programming, 39:3 29, [26] O. Rüthing, J. Knoop, and B. Steffen. Sparse code motion. In Conf. Rec. 27th Symp. Principles of Prog. Lang. (POPL 2000), pages ACM, NY, [27] B. Steffen. Data flow analysis as model checking. In Proc. 1st Int. Conf. Theoretical Aspects of Computer Software (TACS 91), LNCS 526, pages Springer-V., ACM SIGPLAN 461 Best of PLDI

3 ACM SIGPLAN 462 Best of PLDI

4 ACM SIGPLAN 463 Best of PLDI

5 ACM SIGPLAN 464 Best of PLDI

6 ACM SIGPLAN 465 Best of PLDI

7 ACM SIGPLAN 466 Best of PLDI

8 ACM SIGPLAN 467 Best of PLDI

9 ACM SIGPLAN 468 Best of PLDI

10 ACM SIGPLAN 469 Best of PLDI

11 ACM SIGPLAN 470 Best of PLDI

12 ACM SIGPLAN 471 Best of PLDI

13 ACM SIGPLAN 472 Best of PLDI

E-path PRE Partial Redundancy Elimination Made Easy

E-path PRE Partial Redundancy Elimination Made Easy E-path PRE Partial Redundancy Elimination Made Easy Dhananjay M. Dhamdhere dmd@cse.iitb.ac.in Department of Computer Science and Engineering Indian Institute of Technology, Mumbai 400 076 (India). Abstract

More information

Code Placement, Code Motion

Code Placement, Code Motion Code Placement, Code Motion Compiler Construction Course Winter Term 2009/2010 saarland university computer science 2 Why? Loop-invariant code motion Global value numbering destroys block membership Remove

More information

An Implementation of Lazy Code Motion for Machine SUIF

An Implementation of Lazy Code Motion for Machine SUIF An Implementation of Lazy Code Motion for Machine SUIF Laurent Rolaz Swiss Federal Institute of Technology Processor Architecture Laboratory Lausanne 28th March 2003 1 Introduction Optimizing compiler

More information

Partial Redundancy Elimination and SSA Form

Partial Redundancy Elimination and SSA Form Topic 5a Partial Redundancy Elimination and SSA Form 2008-03-26 \course\cpeg421-08s\topic-5a.ppt\course\cpeg421-07s\topic- 7b.ppt 1 References Robert Kennedy, Sun Chan, Shin-ming Liu, Raymond Lo, Pend

More information

A Fresh Look at PRE as a Maximum Flow Problem

A Fresh Look at PRE as a Maximum Flow Problem CC 06, pages 39 -- 54, 2006. A Fresh Look at PRE as a Maximum Flow Problem Jingling Xue and Jens Knoop Programming Languages and Compilers Group, School of Computer Science and Engineering, University

More information

Code-Size Sensitive Partial Redundancy Elimination

Code-Size Sensitive Partial Redundancy Elimination Code-Size Sensitive Partial Redundancy Elimination Oliver Rüthing, Jens Knoop, and Bernhard Steffen Universität Dortmund, Baroper Str. 301, D-44221 Dortmund, Germany {ruething,knoop,steffen}@ls5.cs.uni-dortmund.de

More information

Code Motion and Code Placement: Just Synonyms?*

Code Motion and Code Placement: Just Synonyms?* Code Motion and Code Placement: Just Synonyms?* Jens Knoop 1.*, Oliver Riithing 2, and Bernhard Steffen 2 1Universit~tPassau, D-94030 Passau, Germany e-mail:knoop~fmi.uni-passau.de 2 Universit~t Dortmund,

More information

A Fresh Look at PRE as a Maximum Flow Problem

A Fresh Look at PRE as a Maximum Flow Problem A Fresh Look at PRE as a Maximum Flow Problem Jingling Xue and Jens Knoop 2 Programming Languages and Compilers Group, School of Computer Science and Engineering, University of New South Wales, Sydney,

More information

Lazy Code Motion. Comp 512 Spring 2011

Lazy Code Motion. Comp 512 Spring 2011 Comp 512 Spring 2011 Lazy Code Motion Lazy Code Motion, J. Knoop, O. Ruthing, & B. Steffen, in Proceedings of the ACM SIGPLAN 92 Conference on Programming Language Design and Implementation, June 1992.

More information

DFA&:OPT-METAFrame: A Tool Kit for Program Analysis and Optimization

DFA&:OPT-METAFrame: A Tool Kit for Program Analysis and Optimization DFA&:OPT-METAFrame: A Tool Kit for Program Analysis and Optimization Marion Klein* Dirk Koschiitzki t Jens Knoop t Bernhard Steffen t ABSTRACT Whereas the construction process of a compiler for the early

More information

The SGI Pro64 Compiler Infrastructure - A Tutorial

The SGI Pro64 Compiler Infrastructure - A Tutorial The SGI Pro64 Compiler Infrastructure - A Tutorial Guang R. Gao (U of Delaware) J. Dehnert (SGI) J. N. Amaral (U of Alberta) R. Towle (SGI) Acknowledgement The SGI Compiler Development Teams The MIPSpro/Pro64

More information

Optimal and Efficient Speculation-Based Partial Redundancy Elimination

Optimal and Efficient Speculation-Based Partial Redundancy Elimination To appear in 1st IEEE/ACM Int. Symposium on Code Generation and Optimization (CGO 03). Optimal and Efficient Speculation-Based Partial Redundancy Elimination Qiong Cai and Jingling Xue School of Computer

More information

A Variation of Knoop, ROthing, and Steffen's Lazy Code Motion

A Variation of Knoop, ROthing, and Steffen's Lazy Code Motion A Variation of Knoop, ROthing, and Steffen's Lazy Code Motion by Karl-Heinz Drechsler and Manfred P. Stadel Siemens Nixdorf Informationssysteme AG, STM SD 2 Otto Hahn Ring 6, 8000 Mtinchen 83, Germany

More information

Roy Dz-Ching Ju Tin-Fook Ngai Sun Chan Microprocessor Research Lab. Intel Corporation Santa Clara, CA U.S.A. {jin, tchen, hsu,

Roy Dz-Ching Ju Tin-Fook Ngai Sun Chan Microprocessor Research Lab. Intel Corporation Santa Clara, CA U.S.A. {jin, tchen, hsu, A Compiler Framework for Speculative Analysis and Optimizations Jin Lin Tong Chen Wei-Chung Hsu Pen-Chung Yew Department of Computer Science and Engineering University of Minnesota Minneapolis, MN 55455

More information

Partial Redundancy Analysis

Partial Redundancy Analysis Partial Redundancy Analysis Partial Redundancy Analysis is a boolean-valued data flow analysis that generalizes available expression analysis. Ordinary available expression analysis tells us if an expression

More information

Optimizing for Space and Time Usage with Speculative Partial Redundancy Elimination

Optimizing for Space and Time Usage with Speculative Partial Redundancy Elimination Optimizing for Space and Time Usage with Speculative Partial Redundancy Elimination Bernhard Scholz School of Information Technologies Madsen Building F09 University of Sydney NSW 2006, Australia scholz@it.usyd.edu.au

More information

Partial Redundancy Elimination using Lazy Code Motion

Partial Redundancy Elimination using Lazy Code Motion Partial Redundancy Elimination using Lazy Code Motion Sandeep Dasgupta 1 Tanmay Gangwani 2 May 11, 2014 1 Electronic address: sdasgup3@illinois.edu 2 Electronic address: gangwan2@illinois.edu 2 1. Problem

More information

Advanced Slicing of Sequential and Concurrent Programs

Advanced Slicing of Sequential and Concurrent Programs Advanced Slicing of Sequential and Concurrent Programs Jens Krinke FernUniversität in Hagen, Germany JensKrinke@FernUni-Hagende Abstract Program slicing is a technique to identify statements that may influence

More information

Optimal and Efficient Speculation-Based Partial Redundancy Elimination

Optimal and Efficient Speculation-Based Partial Redundancy Elimination To appear in 1st IEEE/ACM Int. Symposium on Code Generation and Optimization (CGO 03). Optimal and Efficient Speculation-Based Partial Redundancy Elimination Qiong Cai and Jingling Xue School of Computer

More information

Interprocedural Dependence Analysis and Parallelization

Interprocedural Dependence Analysis and Parallelization RETROSPECTIVE: Interprocedural Dependence Analysis and Parallelization Michael G Burke IBM T.J. Watson Research Labs P.O. Box 704 Yorktown Heights, NY 10598 USA mgburke@us.ibm.com Ron K. Cytron Department

More information

Task Response Time Optimization Using Cost-Based Operation Motion

Task Response Time Optimization Using Cost-Based Operation Motion Task Response Time Optimization Using Cost-Based Operation Motion Abdallah Tabbara +1-510-643-5187 atabbara@eecs.berkeley.edu ABSTRACT We present a technique for task response time improvement based on

More information

TVLA: A SYSTEM FOR GENERATING ABSTRACT INTERPRETERS*

TVLA: A SYSTEM FOR GENERATING ABSTRACT INTERPRETERS* TVLA: A SYSTEM FOR GENERATING ABSTRACT INTERPRETERS* Tal Lev-Ami, Roman Manevich, and Mooly Sagiv Tel Aviv University {tla@trivnet.com, {rumster,msagiv}@post.tau.ac.il} Abstract TVLA (Three-Valued-Logic

More information

Analysis of Pointers and Structures

Analysis of Pointers and Structures RETROSPECTIVE: Analysis of Pointers and Structures David Chase, Mark Wegman, and Ken Zadeck chase@naturalbridge.com, zadeck@naturalbridge.com, wegman@us.ibm.com Historically our paper was important because

More information

A Compiler Framework for Speculative Optimizations

A Compiler Framework for Speculative Optimizations A Compiler Framework for Speculative Optimizations JIN LIN, TONG CHEN, WEI-CHUNG HSU, PEN-CHUNG YEW and ROY DZ-CHING JU, TIN-FOOK NGAI, SUN CHAN Speculative execution, such as control speculation or data

More information

Task Response Time Optimization Using Cost-Based Operation Motion

Task Response Time Optimization Using Cost-Based Operation Motion Task Response Time Optimization Using Cost-Based Operation Motion Bassam Tabbara +1-510-643-5187 tbassam@eecs.berkeley.edu ABSTRACT We present a technique for task response time improvement based on the

More information

A Compiler Framework for Recovery Code Generation in General Speculative Optimizations

A Compiler Framework for Recovery Code Generation in General Speculative Optimizations A Compiler Framework for Recovery Code Generation in General Speculative Optimizations Jin Lin, Wei-Chung Hsu, Pen-Chung Yew, Roy Dz-Ching Ju and Tin-Fook Ngai Department of Computer Science and Microprocessor

More information

Historical Perspective and Further Reading 3.10

Historical Perspective and Further Reading 3.10 3.10 6.13 Historical Perspective and Further Reading 3.10 This section discusses the history of the first pipelined processors, the earliest superscalars, the development of out-of-order and speculative

More information

Code Merge. Flow Analysis. bookkeeping

Code Merge. Flow Analysis. bookkeeping Historic Compilers Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit permission to make copies of these materials

More information

Speculative Register Promotion Using Advanced Load Address Table (ALAT)

Speculative Register Promotion Using Advanced Load Address Table (ALAT) Speculative Register Promotion Using Advanced Load Address Table (ALAT) Jin Lin, Tong Chen, Wei-Chung Hsu and Pen-Chung Yew Department of Computer Science and Engineering University of Minnesota Email:

More information

4.16. Historical Perspective and Further Reading. supercomputer: Any machine still on the drawing board.

4.16. Historical Perspective and Further Reading. supercomputer: Any machine still on the drawing board. supercomputer: Any machine still on the drawing board. Stan Kelly-Bootle, The Devil s DP Dictionary, 1981 4.16 Historical Perspective and Further Reading This section discusses the history of the first

More information

An SSA-based Algorithm for Optimal Speculative Code Motion under an Execution Profile

An SSA-based Algorithm for Optimal Speculative Code Motion under an Execution Profile An SSA-based Algorithm for Optimal Speculative Code Motion under an Execution Profile Hucheng Zhou Tsinghua University zhou-hc07@mails.tsinghua.edu.cn Wenguang Chen Tsinghua University cwg@tsinghua.edu.cn

More information

CS Advanced Compiler Design Course Project

CS Advanced Compiler Design Course Project CS 744 - Advanced Compiler Design Course Project Timeline: Brief project choice e-mail due May 17 Project proposal due May 31 Progress report e-mail due June 23 Presentations approximately July 19, 21

More information

Space Efficient Conservative Garbage Collection

Space Efficient Conservative Garbage Collection RETROSPECTIVE: Space Efficient Conservative Garbage Collection Hans-J. Boehm HP Laboratories 1501 Page Mill Rd. MS 1138 Palo Alto, CA, 94304, USA Hans.Boehm@hp.com ABSTRACT Both type-accurate and conservative

More information

Efficient Separate Compilation of Object-Oriented Languages

Efficient Separate Compilation of Object-Oriented Languages Efficient Separate Compilation of Object-Oriented Languages Jean Privat, Floréal Morandat, and Roland Ducournau LIRMM Université Montpellier II CNRS 161 rue Ada 34392 Montpellier cedex 5, France {privat,morandat,ducour}@lirmm.fr

More information

Memory Redundancy Elimination to Improve Application Energy Efficiency

Memory Redundancy Elimination to Improve Application Energy Efficiency Memory Redundancy Elimination to Improve Application Energy Efficiency Keith D. Cooper and Li Xu Department of Computer Science Rice University Houston, Texas, USA Abstract. Application energy consumption

More information

A Lightweight Language for Software Product Lines Architecture Description

A Lightweight Language for Software Product Lines Architecture Description A Lightweight Language for Software Product Lines Architecture Description Eduardo Silva, Ana Luisa Medeiros, Everton Cavalcante, Thais Batista DIMAp Department of Informatics and Applied Mathematics UFRN

More information

CSC D70: Compiler Optimization LICM: Loop Invariant Code Motion

CSC D70: Compiler Optimization LICM: Loop Invariant Code Motion CSC D70: Compiler Optimization LICM: Loop Invariant Code Motion Prof. Gennady Pekhimenko University of Toronto Winter 2018 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip

More information

CSE 501: Compiler Construction. Course outline. Goals for language implementation. Why study compilers? Models of compilation

CSE 501: Compiler Construction. Course outline. Goals for language implementation. Why study compilers? Models of compilation CSE 501: Compiler Construction Course outline Main focus: program analysis and transformation how to represent programs? how to analyze programs? what to analyze? how to transform programs? what transformations

More information

Optimization on array bound check and Redundancy elimination

Optimization on array bound check and Redundancy elimination Optimization on array bound check and Redundancy elimination Dr V. Vijay Kumar Prof. K.V.N.Sunitha CSE Department CSE Department JNTU, JNTU, School of Information Technology, G.N.I.T.S, Kukatpally, Shaikpet,

More information

Title: ====== Open Research Compiler (ORC): Proliferation of Technologies and Tools

Title: ====== Open Research Compiler (ORC): Proliferation of Technologies and Tools Tutorial Proposal to Micro-36 Title: ====== Open Research Compiler (ORC): Proliferation of Technologies and Tools Abstract: ========= Open Research Compiler (ORC) has been well adopted by the research

More information

Efficient Separate Compilation of Object-Oriented Languages

Efficient Separate Compilation of Object-Oriented Languages Efficient Separate Compilation of Object-Oriented Languages Jean Privat, Floréal Morandat, and Roland Ducournau LIRMM Université Montpellier II CNRS 161 rue Ada 34392 Montpellier cedex 5, France {privat,morandat,ducour}@lirmm.fr

More information

CS 701. Class Meets. Instructor. Teaching Assistant. Key Dates. Charles N. Fischer. Fall Tuesdays & Thursdays, 11:00 12: Engineering Hall

CS 701. Class Meets. Instructor. Teaching Assistant. Key Dates. Charles N. Fischer. Fall Tuesdays & Thursdays, 11:00 12: Engineering Hall CS 701 Charles N. Fischer Class Meets Tuesdays & Thursdays, 11:00 12:15 2321 Engineering Hall Fall 2003 Instructor http://www.cs.wisc.edu/~fischer/cs703.html Charles N. Fischer 5397 Computer Sciences Telephone:

More information

7. Optimization! Prof. O. Nierstrasz! Lecture notes by Marcus Denker!

7. Optimization! Prof. O. Nierstrasz! Lecture notes by Marcus Denker! 7. Optimization! Prof. O. Nierstrasz! Lecture notes by Marcus Denker! Roadmap > Introduction! > Optimizations in the Back-end! > The Optimizer! > SSA Optimizations! > Advanced Optimizations! 2 Literature!

More information

33. Model Transformation and Program Optimization with Graph Rewrite Systems

33. Model Transformation and Program Optimization with Graph Rewrite Systems 33. Model Transformation and Program Optimization with Graph Rewrite Systems Prof. Dr. Uwe Aßmann Softwaretechnologie Technische Universität Dresden Version 11-0.4, 29.12.11 1) Basic Setting 2) Examples

More information

Optimal Code Motion: Theory and Practice

Optimal Code Motion: Theory and Practice Optimal Code Motion: Theory and Practice JENS KNOOP and OLIVER RUTHING Universitat Kiel and BERNHARD STEFFEN Universitat Passau An implementation-oriented algorithm for lazy code motion is presented that

More information

Code Optimization. Code Optimization

Code Optimization. Code Optimization 161 Code Optimization Code Optimization 162 Two steps: 1. Analysis (to uncover optimization opportunities) 2. Optimizing transformation Optimization: must be semantically correct. shall improve program

More information

Lazy Code Motion. 1 Motivation. Jens Knoop Oliver Ruthing$ Bernhard Steffen

Lazy Code Motion. 1 Motivation. Jens Knoop Oliver Ruthing$ Bernhard Steffen Lazy Code Motion Jens Knoop Oliver Ruthing$ Bernhard Steffen CAU Kielt CAU Kielt RWTH Aachen$ jk@informatik.uni-kiel. dbp.de or@informatik. uni-kiel.dbp.de bus@zeus.informatik. rwth-aachen.de Abstract

More information

Functional programming languages

Functional programming languages Functional programming languages Part V: functional intermediate representations Xavier Leroy INRIA Paris-Rocquencourt MPRI 2-4, 2015 2017 X. Leroy (INRIA) Functional programming languages MPRI 2-4, 2015

More information

Advanced Compiler Construction

Advanced Compiler Construction CS 526 Advanced Compiler Construction http://misailo.cs.illinois.edu/courses/cs526 INTERPROCEDURAL ANALYSIS The slides adapted from Vikram Adve So Far Control Flow Analysis Data Flow Analysis Dependence

More information

Distributed Simulation for Structural VHDL Netlists

Distributed Simulation for Structural VHDL Netlists Distributed Simulation for Structural VHDL Netlists Werner van Almsick 1, Wilfried Daehn 1, David Bernstein 2 1 SICAN GmbH, Germany 2 Vantage Analysis Systems, USA Abstract: This article describes the

More information

3.4 Data-Centric workflow

3.4 Data-Centric workflow 3.4 Data-Centric workflow One of the most important activities in a S-DWH environment is represented by data integration of different and heterogeneous sources. The process of extract, transform, and load

More information

Tour of common optimizations

Tour of common optimizations Tour of common optimizations Simple example foo(z) { x := 3 + 6; y := x 5 return z * y } Simple example foo(z) { x := 3 + 6; y := x 5; return z * y } x:=9; Applying Constant Folding Simple example foo(z)

More information

Theory and Algorithms for the Generation and Validation of Speculative Loop Optimizations

Theory and Algorithms for the Generation and Validation of Speculative Loop Optimizations Theory and Algorithms for the Generation and Validation of Speculative Loop Optimizations Ying Hu Clark Barrett Benjamin Goldberg Department of Computer Science New York University yinghubarrettgoldberg

More information

Barrier Slicing and Chopping

Barrier Slicing and Chopping Barrier Slicing and Chopping Jens Krinke Universität Passau Passau, Germany Abstract One of the critiques on program slicing is that slices presented to the user are hard to understand. This is partly

More information

Managing Open Bug Repositories through Bug Report Prioritization Using SVMs

Managing Open Bug Repositories through Bug Report Prioritization Using SVMs Managing Open Bug Repositories through Bug Report Prioritization Using SVMs Jaweria Kanwal Quaid-i-Azam University, Islamabad kjaweria09@yahoo.com Onaiza Maqbool Quaid-i-Azam University, Islamabad onaiza@qau.edu.pk

More information

Predicated Software Pipelining Technique for Loops with Conditions

Predicated Software Pipelining Technique for Loops with Conditions Predicated Software Pipelining Technique for Loops with Conditions Dragan Milicev and Zoran Jovanovic University of Belgrade E-mail: emiliced@ubbg.etf.bg.ac.yu Abstract An effort to formalize the process

More information

Lecture Notes on Static Single Assignment Form

Lecture Notes on Static Single Assignment Form Lecture Notes on Static Single Assignment Form 15-411: Compiler Design Frank Pfenning Lecture 6 September 12, 2013 1 Introduction In abstract machine code of the kind we have discussed so far, a variable

More information

Formal Methods and Cryptography

Formal Methods and Cryptography Formal Methods and Cryptography Michael Backes 1, Birgit Pfitzmann 2, and Michael Waidner 3 1 Saarland University, Saarbrücken, Germany, backes@cs.uni-sb.de 2 IBM Research, Rueschlikon, Switzerland, bpf@zurich.ibm.com

More information

Kent Academic Repository

Kent Academic Repository Kent Academic Repository Full text document (pdf) Citation for published version Chitil, Olaf (2006) Promoting Non-Strict Programming. In: Draft Proceedings of the 18th International Symposium on Implementation

More information

Calvin Lin The University of Texas at Austin

Calvin Lin The University of Texas at Austin Loop Invariant Code Motion Last Time Loop invariant code motion Value numbering Today Finish value numbering More reuse optimization Common subession elimination Partial redundancy elimination Next Time

More information

CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1

CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1 CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1 1 University of California, Berkeley, USA {pallavi,parkcs,ksen}@eecs.berkeley.edu

More information

A Practical Stride Prefetching Implementation in Global Optimizer

A Practical Stride Prefetching Implementation in Global Optimizer A Practical Stride Prefetching Implementation in Global Optimizer Hucheng Zhou Tsinghua University zhou-hc07@mails.tsinghua.edu.cn Xing Zhou Tsinghua University zhoux07@mails.tsinghua.edu.cn Tianwei Sheng,

More information

Reducing loads and stores in stack architectures

Reducing loads and stores in stack architectures Reducing loads and stores in stack architectures Thomas VanDrunen Antony L. Hosking Jens Palsberg Purdue University, Dept. of Computer Science West Lafayette, IN 47907-1398, USA vandrutj,hosking,palsberg

More information

Control-Flow Refinment via Partial Evaluation

Control-Flow Refinment via Partial Evaluation Control-Flow Refinment via Partial Evaluation Jesús Doménech 1, Samir Genaim 2, and John P. Gallagher 3 1 Universidad Complutense de Madrid, Spain jdomenec@ucm.es 2 Universidad Complutense de Madrid, Spain

More information

Lecture 14 Pointer Analysis

Lecture 14 Pointer Analysis Lecture 14 Pointer Analysis Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis [ALSU 12.4, 12.6-12.7] Phillip B. Gibbons 15-745: Pointer Analysis

More information

The Essence of Compiling with Continuations

The Essence of Compiling with Continuations RETROSPECTIVE: The Essence of Compiling with Continuations Cormac Flanagan Amr Sabry Bruce F. Duba Matthias Felleisen Systems Research Center Compaq cormac.flanagan@compaq.com Dept. of Computer Science

More information

FREQUENT ITEMSET MINING USING PFP-GROWTH VIA SMART SPLITTING

FREQUENT ITEMSET MINING USING PFP-GROWTH VIA SMART SPLITTING FREQUENT ITEMSET MINING USING PFP-GROWTH VIA SMART SPLITTING Neha V. Sonparote, Professor Vijay B. More. Neha V. Sonparote, Dept. of computer Engineering, MET s Institute of Engineering Nashik, Maharashtra,

More information

Linear Scan Register Allocation. Kevin Millikin

Linear Scan Register Allocation. Kevin Millikin Linear Scan Register Allocation Kevin Millikin Register Allocation Register Allocation An important compiler optimization Compiler: unbounded # of virtual registers Processor: bounded (small) # of registers

More information

A VLSI Architecture for H.264/AVC Variable Block Size Motion Estimation

A VLSI Architecture for H.264/AVC Variable Block Size Motion Estimation Journal of Automation and Control Engineering Vol. 3, No. 1, February 20 A VLSI Architecture for H.264/AVC Variable Block Size Motion Estimation Dam. Minh Tung and Tran. Le Thang Dong Center of Electrical

More information

Single-Pass Generation of Static Single Assignment Form for Structured Languages

Single-Pass Generation of Static Single Assignment Form for Structured Languages 1 Single-Pass Generation of Static Single Assignment Form for Structured Languages MARC M. BRANDIS and HANSPETER MÖSSENBÖCK ETH Zürich, Institute for Computer Systems Over the last few years, static single

More information

Lecture 27. Pros and Cons of Pointers. Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis

Lecture 27. Pros and Cons of Pointers. Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis Pros and Cons of Pointers Lecture 27 Pointer Analysis Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis Many procedural languages have pointers

More information

Lecture 20 Pointer Analysis

Lecture 20 Pointer Analysis Lecture 20 Pointer Analysis Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis (Slide content courtesy of Greg Steffan, U. of Toronto) 15-745:

More information

Machine-Independent Optimizations

Machine-Independent Optimizations Chapter 9 Machine-Independent Optimizations High-level language constructs can introduce substantial run-time overhead if we naively translate each construct independently into machine code. This chapter

More information

On Resolution Proofs for Combinational Equivalence Checking

On Resolution Proofs for Combinational Equivalence Checking On Resolution Proofs for Combinational Equivalence Checking Satrajit Chatterjee Alan Mishchenko Robert Brayton Department of EECS U. C. Berkeley {satrajit, alanmi, brayton}@eecs.berkeley.edu Andreas Kuehlmann

More information

Combining Analyses, Combining Optimizations - Summary

Combining Analyses, Combining Optimizations - Summary Combining Analyses, Combining Optimizations - Summary 1. INTRODUCTION Cliff Click s thesis Combining Analysis, Combining Optimizations [Click and Cooper 1995] uses a structurally different intermediate

More information

Bisection Debugging. 1 Introduction. Thomas Gross. Carnegie Mellon University. Preliminary version

Bisection Debugging. 1 Introduction. Thomas Gross. Carnegie Mellon University. Preliminary version Bisection Debugging Thomas Gross School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Institut für Computer Systeme ETH Zürich CH 8092 Zürich Preliminary version Abstract This paper

More information

Mapping Vector Codes to a Stream Processor (Imagine)

Mapping Vector Codes to a Stream Processor (Imagine) Mapping Vector Codes to a Stream Processor (Imagine) Mehdi Baradaran Tahoori and Paul Wang Lee {mtahoori,paulwlee}@stanford.edu Abstract: We examined some basic problems in mapping vector codes to stream

More information

CSE 141: Computer Architecture. Professor: Michael Taylor. UCSD Department of Computer Science & Engineering

CSE 141: Computer Architecture. Professor: Michael Taylor. UCSD Department of Computer Science & Engineering CSE 141: Computer 0 Architecture Professor: Michael Taylor RF UCSD Department of Computer Science & Engineering Computer Architecture from 10,000 feet foo(int x) {.. } Class of application Physics Computer

More information

On Algebraic Expressions of Generalized Fibonacci Graphs

On Algebraic Expressions of Generalized Fibonacci Graphs On Algebraic Expressions of Generalized Fibonacci Graphs MARK KORENBLIT and VADIM E LEVIT Department of Computer Science Holon Academic Institute of Technology 5 Golomb Str, PO Box 305, Holon 580 ISRAEL

More information

Lecture Notes on Loop Optimizations

Lecture Notes on Loop Optimizations Lecture Notes on Loop Optimizations 15-411: Compiler Design Frank Pfenning Lecture 17 October 22, 2013 1 Introduction Optimizing loops is particularly important in compilation, since loops (and in particular

More information

Flexibility and Robustness of Hierarchical Fuzzy Signature Structures with Perturbed Input Data

Flexibility and Robustness of Hierarchical Fuzzy Signature Structures with Perturbed Input Data Flexibility and Robustness of Hierarchical Fuzzy Signature Structures with Perturbed Input Data B. Sumudu U. Mendis Department of Computer Science The Australian National University Canberra, ACT 0200,

More information

C-SSAPRE: Eliminating redundancy over copies

C-SSAPRE: Eliminating redundancy over copies C-SSAPRE: Eliminating redundancy over copies Tom Murphy VII, Brendan McMahan 7 May 2003 1 Introduction Partial Redundancy Elimination (PRE) is an optimization that prevents, where possible, the re-computation

More information

Lecture 5. Partial Redundancy Elimination

Lecture 5. Partial Redundancy Elimination Lecture 5 Partial Redundancy Elimination I. Forms of redundancy global common subexpression elimination loop invariant code motion partial redundancy II. Lazy Code Motion Algorithm Mathematical concept:

More information

Design Principles for a Beginning Programming Language

Design Principles for a Beginning Programming Language Design Principles for a Beginning Programming Language John T Minor and Laxmi P Gewali School of Computer Science University of Nevada, Las Vegas Abstract: We consider the issue of designing an appropriate

More information

A Teaching Environment to Model and Simulate Computer Processors

A Teaching Environment to Model and Simulate Computer Processors A Teaching Environment to Model and Simulate Computer Processors Sebastiano PIZZUTILO and Filippo TANGORRA Dipartimento di Informatica Università degli Studi di Bari via Orabona 4, 70126 Bari ITALY Abstract:

More information

CPSC 510 (Fall 2007, Winter 2008) Compiler Construction II

CPSC 510 (Fall 2007, Winter 2008) Compiler Construction II CPSC 510 (Fall 2007, Winter 2008) Compiler Construction II Robin Cockett Department of Computer Science University of Calgary Alberta, Canada robin@cpsc.ucalgary.ca Sept. 2007 Introduction to the course

More information

Introduction to Compilers

Introduction to Compilers Introduction to Compilers Compilers are language translators input: program in one language output: equivalent program in another language Introduction to Compilers Two types Compilers offline Data Program

More information

Dealing with Failures during Failure Recovery of Distributed Systems

Dealing with Failures during Failure Recovery of Distributed Systems Dealing with Failures during Failure Recovery of Distributed Systems Naveed Arshad Computer Science Dept. University of Colorado Boulder, CO 80309 arshad@cs.colorado.edu Dennis Heimbigner Computer Science

More information

Example. Example. Constant Propagation in SSA

Example. Example. Constant Propagation in SSA Example x=1 a=x x=2 b=x x=1 x==10 c=x x++ print x Original CFG x 1 =1 a=x 1 x 2 =2 x 3 =φ (x 1,x 2 ) b=x 3 x 4 =1 x 5 = φ(x 4,x 6 ) x 5 ==10 c=x 5 x 6 =x 5 +1 print x 5 CFG in SSA Form In SSA form computing

More information

Conditional Elimination through Code Duplication

Conditional Elimination through Code Duplication Conditional Elimination through Code Duplication Joachim Breitner May 27, 2011 We propose an optimizing transformation which reduces program runtime at the expense of program size by eliminating conditional

More information

On Meaning Preservation of a Calculus of Records

On Meaning Preservation of a Calculus of Records On Meaning Preservation of a Calculus of Records Emily Christiansen and Elena Machkasova Computer Science Discipline University of Minnesota, Morris Morris, MN 56267 chri1101, elenam@morris.umn.edu Abstract

More information

How Much Logic Should Go in an FPGA Logic Block?

How Much Logic Should Go in an FPGA Logic Block? How Much Logic Should Go in an FPGA Logic Block? Vaughn Betz and Jonathan Rose Department of Electrical and Computer Engineering, University of Toronto Toronto, Ontario, Canada M5S 3G4 {vaughn, jayar}@eecgutorontoca

More information

Intra-procedural Data Flow Analysis Introduction

Intra-procedural Data Flow Analysis Introduction The Setting: Optimising Compilers The Essence of Program Analysis Reaching Definitions Analysis Intra-procedural Data Flow Analysis Introduction Hanne Riis Nielson and Flemming Nielson email: {riis,nielson}@immdtudk

More information

A Model Transformation from Misuse Cases to Secure Tropos

A Model Transformation from Misuse Cases to Secure Tropos A Model Transformation from Misuse Cases to Secure Tropos Naved Ahmed 1, Raimundas Matulevičius 1, and Haralambos Mouratidis 2 1 Institute of Computer Science, University of Tartu, Estonia {naved,rma}@ut.ee

More information

Lecture 16 Pointer Analysis

Lecture 16 Pointer Analysis Pros and Cons of Pointers Lecture 16 Pointer Analysis Basics Design Options Pointer Analysis Algorithms Pointer Analysis Using BDDs Probabilistic Pointer Analysis Many procedural languages have pointers

More information

Optimization Prof. James L. Frankel Harvard University

Optimization Prof. James L. Frankel Harvard University Optimization Prof. James L. Frankel Harvard University Version of 4:24 PM 1-May-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reasons to Optimize Reduce execution time Reduce memory

More information

Using Cache Line Coloring to Perform Aggressive Procedure Inlining

Using Cache Line Coloring to Perform Aggressive Procedure Inlining Using Cache Line Coloring to Perform Aggressive Procedure Inlining Hakan Aydın David Kaeli Department of Electrical and Computer Engineering Northeastern University Boston, MA, 02115 {haydin,kaeli}@ece.neu.edu

More information

Semi supervised clustering for Text Clustering

Semi supervised clustering for Text Clustering Semi supervised clustering for Text Clustering N.Saranya 1 Assistant Professor, Department of Computer Science and Engineering, Sri Eshwar College of Engineering, Coimbatore 1 ABSTRACT: Based on clustering

More information

RESTORATION OF DEGRADED DOCUMENTS USING IMAGE BINARIZATION TECHNIQUE

RESTORATION OF DEGRADED DOCUMENTS USING IMAGE BINARIZATION TECHNIQUE RESTORATION OF DEGRADED DOCUMENTS USING IMAGE BINARIZATION TECHNIQUE K. Kaviya Selvi 1 and R. S. Sabeenian 2 1 Department of Electronics and Communication Engineering, Communication Systems, Sona College

More information

Lecture Notes on Liveness Analysis

Lecture Notes on Liveness Analysis Lecture Notes on Liveness Analysis 15-411: Compiler Design Frank Pfenning André Platzer Lecture 4 1 Introduction We will see different kinds of program analyses in the course, most of them for the purpose

More information