Interprocedural Constant Propagation

Similar documents
General Flow-Sensitive Pointer Analysis and Call Graph Construction

KEEP THIS COPY FOR REPRODUCTION PURPOSES. I ~~~~~Final Report

An Exception Monitoring System for Java

The Performance of Scalar Replacement on the HP 715/50

µz An Efficient Engine for Fixed points with Constraints

Write Barrier Removal by Static Analysis

Curriculum Vitae Michael M. Zavlanos

Analysis One Code Desc. Transaction Amount. Fiscal Period

AT&T Global Network Client for Windows Product Support Matrix January 29, 2015

Continuous Code-Quality Assurance with SAFE

ROBERT SALCIDO CONFERENCE PRESENTATIONS

Sharareh Noorbaloochi Department of Psychology New York University 6 Washington Place, 559, New York, NY noorbaloochi@nyu.

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

Address Taken FIAlias, which is equivalent to Steensgaard. CS553 Lecture Alias Analysis II 2

9700 South Cass Avenue, Lemont, IL URL: fulin

Lecture 10 Partial Redundancy Elimination

F CUS your recruitment dollars on top scientists and engineers.

Static Single Assignment Form. Masataka Sassa (Tokyo Institute of Technology)

Subject to Change 1 As of 8/13/14

Review; questions Discussion of Semester Project Arbitrary interprocedural control flow Assign (see Schedule for links)

CHILDREN AND YOUNG PEOPLE'S PLAN: PLANNING AND PERFORMANCE MANAGEMENT STRATEGY

A Thread Monitoring System for Multithreaded Java Programs

Curriculum Vitae. Shan Shan Huang

Gerald Roth. Department of Electrical Engineering and Computer Science School of Engineering Vanderbilt University Nashville, TN

American Payroll Association PAYROLL TRAINING PROGRAM

Breen Elementary School

Comprehensive Course Schedule

Variable Neighbourhood Search for the Global Optimization of Constrained NLPs

Case 2:08-cv ABC-E Document 1-4 Filed 04/15/2008 Page 1 of 138. Exhibit 8

CENTERPOINT ENERGY TEXARKANA SERVICE AREA GAS SUPPLY RATE (GSR) JULY Small Commercial Service (SCS-1) GSR

Students summarize a data set using box plots, the median, and the interquartile range. Students use box plots to compare two data distributions.

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Comprehensive Course Schedule

National Special Security Events

Components for Operating System Design

Bob Boothe. Education. Research Interests. Teaching Experience

IEEE Citation style guide

Protocol for the Systematic Literature Review on Web Development Resource Estimation

Aspect Refactoring Verifier

Keywords- Program Slicing, PDG, Data dependence, Control dependence, Static Slice, Dynamic Slice.

Chia-Yen Lee ( 李 家 岩 )

IEEE Style Guidelines & Examples NAIT Library. Table of Contents

Curriculum Vitae. Vladimír Guzma. Flat 16, Moore Court, 2 Dodd Road, WD24 5DA, Watford, United Kingdom Telephone(s) +44 (0)

Preschool Science Curriculum Map

The Use of Traces for Inlining in Java Programs

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions

Ways We Use Integers. Negative Numbers in Bar Graphs

Incremental Slicing Based on Data-Dependences Types

Enhanced Vessel Traffic Management System Booking Slots Available and Vessels Booked per Day From 12-JAN-2016 To 30-JUN-2017

Caring by Nature. Distinguished by Experience. Qualified by Degree. Bellevue University RN to BSN Guide

An On-Line Algorithm for Checkpoint Placement

Fast Sequential Summation Algorithms Using Augmented Data Structures

Editorial to the special issue of Computers & Operations Research on Search-Based Software Engineering

ROYAL REHAB COLLEGE AND THE ENTOURAGE EDUCATION GROUP. UPDATED SCHEDULE OF VET UNITS OF STUDY AND VET TUITION FEES Course Aug 1/2015

Working Capital and the Financing Decision C H A P T E R S I X

VITA Charles David SKIPTON Kempton Court Dept of Economics / Sykes COB

Graphing and Interpreting CBM Scores

Food Bank Inventory Tracking. Rachel Barnecut Lucia Huntting Jeremy Lenz Ashley Riel Kelly Schalow Christiana Wu

The Role of Controlled Experiments in Software Engineering Research

Hillgrove High School Fall Parking Schedule and Application

Software Tamper Resistance: Obstructing Static Analysis of Programs

How To Write A Program Design Article

Craig A. Damon. Education. Academic Positions. Teaching Experience. Ph.D., Carnegie Mellon University, Pittsburgh, PA

Ashley Institute of Training Schedule of VET Tuition Fees 2015

State Annual Report Due Dates for Business Entities page 1 of 10

A!Team!Cymru!EIS!Report:!Growing!Exploitation!of!Small! OfCice!Routers!Creating!Serious!Risks!

INTERNET-BASED COLLABORATIVE PROGRAMMING TECHNIQUES AND ENVIRONMENTS

POLICY FOR COLLABORATIVE RESEARCH DEGREES. Policy for Split-Site PhD Arrangements. October August Research Office Graduate Education Team

CURRICULUM VITAE Herbert L. Dershem

Resource Allocation Schemes for Gang Scheduling

Writing the basic meeting-announcement news release

Independent Accountants Report on Applying Agreed-Upon Procedures

Time to fill jobs in the US January day. The. tipping point

Linda M. Callahan 407 N. Sixth Street 81 S. Main Street Shelton, WA, Seattle, WA,

University of Illinois at Chicago Office: SEO 521 Department of Mathematics, Statistics, (312) and Computer Science

FY 2015 Schedule at a Glance

Dimensionalizing Big Data. WA State vs. peers. Building on strengths CONTENTS. McKinsey & Company 1

A Robust Dynamic Load-balancing Scheme for Data Parallel Application on Message Passing Architecture

P/T 2B: 2 nd Half of Term (8 weeks) Start: 24-AUG-2015 End: 18-OCT-2015 Start: 19-OCT-2015 End: 13-DEC-2015

Lili SLIS, SJSU

A Fresh Look at Optimizing Array Bound Checking

Victoria Kostina Curriculum Vitae - September 6, 2015 Page 1 of 5. Victoria Kostina

Time Management II. June 5, Copyright 2008, Jason Paul Kazarian. All rights reserved.

June Zhang (Zhong-Ju Zhang)

Department of Political Science Phone: (805) University of California, Santa Barbara Fax: (805)

Register Allocation and Optimal Spill Code Scheduling in Software Pipelined Loops Using 0-1 Integer Linear Programming Formulation

The BBP Algorithm for Pi

REPORTING ORGANIZATIONS

GORMAN MANUFACTURING COMPANY INC SAN FRANCISCO CA United States. (see Corporate Structure for other trading names)

Virtual Machine Learning: Thinking Like a Computer Architect

Vivek Sarkar Rice University. Work done at IBM during

PROJECT MANAGEMENT. Seminars in. Powerful skills for today s toughest PM challenges. save. off any AMA Seminar $200.

Nordica A. MacCarty, Ph.D.

How To Forecast Solar Power

THE RETURN-ON-INVESTMENT (ROI) OF CRM SOLUTIONS

ITIL Foundation. Learn about process improvements, benefits, and challenges of ITIL, and get your ITIL Foundation certification.

ACADEMIC CALENDAR FOR DIVISION OF MEDICAL SCIENCES AT HARVARD MEDICAL SCHOOL GRADUATE SCHOOL OF ARTS AND SCIENCES Ph.D.

Adding Examples into Java Documents

New Experimental Experience Rating (NEER) User Guide

Transcription:

RETROSPECTIVE: Interprocedural Constant Propagation David Callahan Keith D. Cooper Ken Kennedy Linda Torczon Cray Research, Inc. Department of Computer Department of Computer Department of Computer 411 First Avenue South Science Science Science Suite 600 Rice University Rice University Rice University Seattle, WA 98104 Houston, TX 77251-1982 Houston, TX 77251-1982 Houston, TX 77251-1982 david@cray.com keith@rice.edu ken@rice.edu linda@rice.edu 1. INTRODUCTION The notion that the compiler could discover constant-valued variables and use that knowledge to improve programs goes back to the earliest days of compilation. Early work focused on propagating constant values in expressions [14] and, later, in single procedures [17, 25, 20, 26]. Constant propagation was well studied in the literature on data-flow analysis because it is fundamentally harder than most of the classic single-procedure data-flow problems [16]. This paper presents the first standalone algorithm for approximate solution of the interprocedural constant propagation problem. It abstracts the solver into an interprocedural propagation framework and a set of functions that model the intraprocedural propagation of values. We called these latter models jump functions, after an idea that John Cocke had proposed in a different context. As part of her thesis work, Linda Torczon developed the algorithms for interprocedural constant propagation that appear in this paper [24]. David Callahan did the first implementation of these ideas in the PFC (Parallel Fortran Converter) project at Rice. This paper presents one of the first practical solutions for approximating the answers to a flow-sensitive interprocedural problem. 2. BACKGROUND This work has its origins in the R n Programming Environment project at Rice. One of its goals was to attack the problems associated with performing interprocedural analysis and optimization in a compiler. The environment supported Fortran 77. At that time, few compilers employed interprocedural techniques because of the conflict between the programmer s need for separate compilation and the compiler s need for information about the internals of every procedure in the program. Collecting this information required, at least, a linear pass over the entire program a much higher price than one would incur with separate compilation. One of the central ideas in R n was that the environment could perform per-procedure analysis when the programmer saved code from the environment s editor. This avoids the cost of re-analyzing the code on each compilation. It also creates a situation where recompilation analysis can limit the amount of compilation required in response to an editing change [12, 8]. Two major factors influenced our decision to tackle interprocedural constant propagation. First, several recent papers had focused on improvements due to procedure integration. Scheifler studied procedure integration in CLU [23]. Ball showed a simple method for predicting the improvement possible with inline substitution, 20 Years of the ACM/SIGPLAN Conference on Programming Language Design and Implementation (1979-1999): A Selection, 2003. Copyright 2003 ACM 1-58113-623-4...$5.00. based on knowledge of the constant-valued parameters at a call site [4]. Allen, et al. showed the potential for interprocedural improvement in their influential Experimental Compiling System [2]. Second, a growing body of evidence suggested that many call sites pass constant values as actual parameters, particularly to library routines [2, 13]. Interprocedural constant propagation was an obvious next step after computing flow-insensitive summary sets [11]. The formulation in the paper uses an optimistic, worklist-driven, iterative data-flow algorithm to compute sets of constants that hold on entry to each procedure. Our goal was an algorithm that captured the style and insights of the single-procedure algorithm operating on def-use chains, without paying the full cost of abstract interpretation each time it examined a procedure. The final algorithm uses an iterative solver to model the flow of values between procedures. It uses abstract jump function to model the flow of values through a procedure. These jump functions play the role of complex instructions that summarize the behavior of an entire procedure, capturing the flow of values into and out of the procedure. The precision of the jump functions can vary with the amount of effort spent computing them. We proposed several ways to implement jump functions; in the R n framework, the editor would produce them. The iterative interprocedural solver would call on jump functions as needed to propagate values drawn from the usual constant propagation lattice. The set of constants that the algorithm discovered depended on the precision of the computed jump functions. 3. INFLUENCE The first papers to explicitly discuss interprocedural constant propagation were our paper and the companion paper in the same session by Burke and Cytron [7]. Earlier systems had addressed the issue through a combination of inline substitution and global constant propagation [2, 26]. Interprocedural constant propagation has become an important analysis tool in aggressive optimizing compilers, particularly systems that try to automatically discover parallelism [6]. The algorithms described in this paper were implemented in the PFC system [3] and the Convex Applications Compiler [18]. The PTRAN system used an algorithm that propagated literal constant arguments along parameter binding chains in the program [1]. The ParaScope system used an early version of the FIAT analyzer to perform interprocedural constant propagation [10]. A later version of FIAT was used in the SUIF system; today, SUIF performs constant propagation as part of a general interprocedural symbolic analysis [19]. Since this paper appeared, many papers on interprocedural constant propagation have appeared. Allen, et al. described the flowinsensitive algorithm used in PTRAN [1]. Wegman and Zadeck ACM SIGPLAN 155 Best of PLDI 1979-1999

showed how to combine their intraprocedural algorithm with inline substitution to capture interprocedural constants [27]. Grove and Torczon published a study of the effectiveness of different jumpfunction implementations [15]. Binkley proposed an algorithm that performs interprocedural analysis over a variant on the programdependence graph [5]. Carini and Hind developed an algorithm that performs flow-sensitive constant propagation, with support for general recursion, while using only one flow-sensitive analysis of each procedure [9]. Sagiv, Reps, and Horwitz describe contextsensitive algorithms for two important subsets of interprocedural constant propagation [22, 21]. 4. ACKNOWLEDGMENTS The research described in the paper was supported by both the National Science Foundation and by IBM Corporation. Our many colleagues who worked on the R n environment created a software system and a climate in which we could tackle problems like this one. To all these people, we owe a debt of thanks. REFERENCES [1] F. Allen, M. Burke, P. Charles, R. Cytron, and J. Ferrante. An overview of the PTRAN analysis systems for multiprocessing. Journal of Parallel and Distributed Computation, 5(5):617 640, 1988. [2] F. Allen, J. Carter, J. Fabri, J. Ferrante, W. Harrison, P. Loewner, and L. Trevillyan. The experimental compiling system. IBM Journal of Research and Development, 24(6):695 715, Nov. 1980. [3] J. Allen and K. Kennedy. PFC: a program to convert FORTRAN to parallel form. In K. Hwang, editor, Supercomputers: Design and Applications. IEEE Computer Society Press, 1984. [4] J. E. Ball. Predicting the effects of optimization on a procedure body. SIGPLAN Notices, 14(8):214 220, Aug. 1979. Proceedings of the ACM SIGPLAN 79 Symposium on Compiler Construction. [5] D. Binkley. Interprocedural constant propagation using dependence graphs and a data-flow model. In Proceedings of the 5 th International Conference on Compiler Construction, pages 374 388, 1994. Springer Verlag LNCS 786. [6] W. Blume and R. Eigenmann. An overview of symbolic analysis techniques needed for the effective parallelization of the Perfect benchmarks. In Proceedings of the 23 rd International Conference on Parallel Processing, Volume 2: Software, pages 233 238. CRC Press, Aug. 1994. [7] M. Burke and R. Cytron. Interprocedural dependence analysis and parallelization. SIGPLAN Notices, 21(7):162 175, July 1986. Proceedings of the ACM SIGPLAN 86 Symposium on Compiler Construction. [8] M. Burke and L. Torczon. Interprocedural optimization: Eliminating unnecessary recompilation. ACMTransactions on Programming Languages and Systems, 15(3):367 399, July 1993. [9] P. R. Carini and M. Hind. Flow-sensitive interprocedural constant propagation. SIGPLAN Notices, 30(6):23 31, June 1995. Proceedings of the ACM SIGPLAN 95 Conference on Programming Language Design and Implementation. [10] A. Carle, M. Hall, J. Mellor-Crummey, and R. Rodriguez. FIAT: A framework for interprocedural analysis and transformation. In Proceedings of the Sixth Workshop on Langauges and Compilers for Parallel Computing, pages 522 545, Aug. 1993. [11] K. D. Cooper and K. Kennedy. Interprocedural side-effect analysis in linear time. SIGPLAN Notices, 23(7):57 66, July 1988. Proceedings of the ACM SIGPLAN 88 Conference on Programming Language Design and Implementation. [12] K. D. Cooper, K. Kennedy, and L. Torczon. Interprocedural optimization: Eliminating unnecessary recompilation. SIGPLAN Notices, 21(7):58 67, July 1986. Proceedings of the ACM SIGPLAN 86 Symposium on Compiler Construction. [13] J. Dongarra. LINPACK working note #3: FORTRAN BLAS timing. Technical Report ANL-80-24, Argonne National Laboratory, Feb. 1980. [14] R. Floyd. An algorithm for coding efficient arithmetic expressions. Communications of the ACM, 22(5):42 51, Jan. 1961. [15] D. Grove and L. Torczon. Interprocedural constant propagation: A study of jump function implementations. SIGPLAN Notices, 28(6):90 99, June 1993. Proceedings of the ACM SIGPLAN 93 Conference on Programming Language Design and Implementation. [16] J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Inf., 7:305 317, 1977. [17] G. A. Kildall. A unified approach to global program optimization. In Conference Record of the ACM Symposium on Principles of Programming Languages, pages 194 206, Boston, MA, USA, Oct. 1973. [18] R. Metzger and P. Smith. The CONVEX application compiler. Fortran Journal, 3(1):8 10, 1991. [19] B. R. Murphy. Frameworks for Precise Program Analysis. PhD thesis, Department of Computer Science, Stanford University, Dec. 2001. [20] J. H. Reif and H. R. Lewis. Symbolic evaluation and the global value graph. In Conference Record of the Fourth ACM Symposium on Principles of Programming Languages, pages 104 118, Los Angeles, CA, USA, Jan. 1977. [21] T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Conference Record of POPL 95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 49 61, San Francisco, CA, USA, Jan. 1995. [22] M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with application to constant propagation. In Proceedings of the 6 th International Conference on Theory and Practice of Software Development (TAPSOFT), pages 651 665, 1995. [23] R. W. Scheifler. An analysis of inline substitution for a structured programming language. Communications of the ACM, 20(9):647 654, 1977. [24] L. Torczon. Compilation Dependences in an Ambitious Optimizing Compiler. PhD thesis, Department of Computer Science, Rice University, May 1985. [25] B. Wegbreit. Property extraction in well-founded sets. IEEE Transactions on Software Engineering, 1(3), Sept. 1975. [26] M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. In Conference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pages 291 299, New Orleans, LA, USA, Jan. 1985. [27] M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181 210, Apr. 1991. ACM SIGPLAN 156 Best of PLDI 1979-1999

ACM SIGPLAN 157 Best of PLDI 1979-1999

ACM SIGPLAN 158 Best of PLDI 1979-1999

ACM SIGPLAN 159 Best of PLDI 1979-1999

ACM SIGPLAN 160 Best of PLDI 1979-1999

ACM SIGPLAN 161 Best of PLDI 1979-1999

ACM SIGPLAN 162 Best of PLDI 1979-1999

ACM SIGPLAN 163 Best of PLDI 1979-1999

ACM SIGPLAN 164 Best of PLDI 1979-1999

ACM SIGPLAN 165 Best of PLDI 1979-1999

ACM SIGPLAN 166 Best of PLDI 1979-1999