: Compiler Design. 9.6 Available expressions 9.7 Busy expressions. Thomas R. Gross. Computer Science Department ETH Zurich, Switzerland

Size: px
Start display at page:

Download ": Compiler Design. 9.6 Available expressions 9.7 Busy expressions. Thomas R. Gross. Computer Science Department ETH Zurich, Switzerland"

Transcription

1 : Compiler Design 9.6 Available expressions 9.7 Busy expressions Thomas R. Gross Computer Science Department ETH Zurich, Switzerland

2 Available expressions An expression a+b is available at a point P if a+b is evaluated on every path from ENTRY to P and there is no defininon of a or b on this path aoer a+b was evaluated Interested in set of expressions available at the start of a basic block B Set depends on paths that lead to P before_b Assume that a+b has no side effects Reading a memory locacon may have side effects too! Not a problem for JavaLi or Java 2

3 Available expressions e1: x = a + b if (Tcond) B1 B2?? Is a+b computed in e1 available for e2? Available at P Depends on B2 P e2: y = a + b B3 3

4 Available expressions e1: x = a + b if (Tcond) B1 B2 a = Is a+b computed in e1 available for e2? No a may have at P a value that differs from the value at e1. P e2: y = a + b B3 4

5 Available expressions e1: x = a + b if (Tcond) B1 B2 a = e3: z = a + b Is a+b available for e2? Yes either computed by e1 or by e3 P e2: y = a + b B3 5

6 Transfer funcnon e: = a + b B a+b is available at the end of basic block B if there is no stmt in B that follows e and that defines a or b Must be conservacve If a statement in the shaded region may modify a (or b) then a+b is not available at the end of B 6

7 Transfer funcnon P before_b d: a = B P aoer_b (Maybe) a+b is available at P before_b. a+b is not available at P aoer_b Unless there is a statement in B that follows d and re-computes a+b, see last slide DefiniNon d has killed the expression a+b 7

8 Transfer funcnon d: x = e: = a + b Define for basic block B gen B = { expr expr a+b is evaluated in B, neither a nor b subsequently defined in B } kill B = { expr a or b of expr a+b defined in B and a+b is not subsequently evaluated in B } Must be conservanve In gen only if we are sure the expression is evaluated In kill if there is a chance that one of the operands of a+b is defined 8

9 Transfer funcnon IN(B) d: x = e: = a + b B OUT(B) Want to find sets IN(B): set of expressions available at start of B OUT(B): set of expressions available at end of B Transfer funcnon captures how statements in B determine OUT(B) 9

10 Transfer funcnon... B1 B2 B3 Given OUT(B1). What should be IN(B2) and IN(B3)? IN(B2) = OUT(B1), IN(B3) = OUT(B1) An expression that is available a_er B1 is available at the start of B2 and the start of B3 10

11 Transfer funcnon B2 B3 P... B1 Given OUT(B2) and OUT(B3) What should be IN(B1)? Expression E is available at P if E is computed on every path from ENTRY to P (and none of the operands of E is killed subsequently) Must consider all paths leading to P E must be available on all paths 11

12 Transfer funcnon B2 B3... B1 Given OUT(Bi) IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) 12

13 Finding IN(B) and OUT(B) gen and kill capture what happens inside a basic block Some texts use e_gen and e_kill to discnguish between sets needed for reaching definicons These sets are different! We need IN and OUT for each basic block IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) OUT(B) = gen B (IN(B) kill B ) N basic blocks, 2 N sets IN / OUT 13

14 Finding IN(B) and OUT(B) N basic blocks, 2 N sets IN / OUT System with 2 N unknowns Solve by iteracng uncl a fixed point is found How to start iteranon? Safe assumpcon OUT[ENTRY] = 14

15 Finding IN(B) and OUT(B) Safe assumpnon OUT[ENTRY] = What about OUT[Bi] for Bi ENTRY? For reaching definicons, we wanted smallest set of definicons that reach OK if we say d reaches but it does not For available expressions, we want largest set of expressions that reach OK if expr is available but not included in set So start with a large approximanon and remove expressions that are clearly not available OUT[Bi] = U! U is the set of all expressions that appear in the program! 15

16 Finding available expressions OUT[ENTRY] = IniCalize OUT[B] = U for B ENTRY while (changes to any OUT(B)) { for (each basic block B ENTRY) { } } IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) OUT(B) = gen B (IN(B) kill B ) 16

17 Comments The algorithm (previous slide) idennfies an expression expr as available only if expr is truly available. InducCon on length of path If expr is not available (along some path) then expr is not in OUT(B) for a block B expr is not available for some predecessor B of B as we use to form IN[B] Again, the order of visinng nodes makers For speed of convergence, not correctness 17

18 Available expressions Is this a forward or a backward problem? 18

19 Available expressions Is this a forward or a backward problem? Forward How similar is it to reaching defininons? Reaching definicons: IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) Available expressions: IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) 19

20 Summary for data flow problems Compute two sets for each basic block B SoluCon = OUT(B) / IN(B) Context = IN(B) / OUT(B) Two sets to capture local effects Define a direccon Reaching definicons, available expressions: Forward Ancestor: predecessor Live variables: Backward Ancestor: successor Init SoluCon(ENTRY) / SoluCon(EXIT) Init remaining SoluCon sets Define a meet operator Reaching definicons, live variables: Available expressions: Iterate over basic blocks B Context(B) = Bi, Bi is ancestor of B in CFG SoluCon(Bi) SoluCon(B) = local_new B (Context(B) local_cut B ) 20

21 Dataflow problems Forward Backward 21

22 Dataflow problems Forward Backward Reaching definicons Live variables Available expressions 22

23 9.7 Busy expressions if ( ) { A[j] = 0; } else { A[j] = 1; } 23

24 IR view if ( ) { tmp1 = j * 4 tmp2 = &A + tmp1 *tmp2 = 0 } else { tmp3 = j * 4 tmp4 = &A + tmp3 *tmp4 = 1 } 24

25 Expression j*4 is evaluated in both branches of the ifstmt HoisNng j*4 to block above the if-stmt reduces the size of the object code No (immediate) speed benefit Expression j*4 is a (very) busy expression. An expression a+b is very busy at a point P if a+b is evaluated on all paths from P to EXIT and there is no defininon of a or b on a path between P and an evaluanon of a+b Interested in set of expressions available at the start of a basic block B Set depends on paths that start at P before_b 26

26 Transfer funcnon S: = a b B a+b is very busy at the start of basic block B if there is no stmt in B prior to S that defines a or b. 27

27 Transfer funcnon S : a = S: = a b a+b is not (very) busy at the start of basic block B as there is a stmt in B prior to S that defines a (stmt S ) 28

28 Transfer funcnon S: = a b Define for basic block B kill B = { expr an operand of expr is defined in B by stmt S and expr is not evaluated before S } gen B = { expr expr is evaluated in B prior to a definicon of any of its operands} Sets kill and gen: must be conservanve In gen only if we are sure the expression is evaluated In kill if there is a chance that the expression is killed 29

29 Transfer funcnon NoNce that we may be interested in the set of busy expressions at the start of a basic block Determined by statements in basic block and statements in subsequent basic blocks Set of busy expressions at the end of a basic block Determined by statements in subsequent basic blocks Another term: expression is downward exposed 30

30 Transfer funcnon IN(B) = {b 1, b 2,, b n } S: = a b For a basic block B we define IN(B) = { expr expr very busy at P before_b } OUT(B) = { expr expr very busy at P a_er_b } OUT(B) = {b 1, b 2,, v m } Expression b IN(B) b is evaluated in B prior to definicon of an operand, i.e. b gen B b OUT(B) and operands of b not defined in B, i.e. b kill B IN(B) = gen B (OUT(B) kill B ) 31

31 Transfer funcnon B2 B3... B1 Given IN(B1) What should be OUT(B2) and OUT(B3)? OUT(B2) = IN(B1), OUT(B3) = IN(B1) 32

32 Transfer funcnon... B1 B2 B3 Given IN(B2) and IN(B3) What should be OUT(B1)? An expression E is very busy at a point P if E is evaluated on all paths from P to EXIT (and there is no definicon of an operand of E between P and such an evaluacon) Must consider all paths starcng at P 33

33 Transfer funcnon... B1 B2 B3 Given IN(Bi) OUT(B) = Bi, Bi is successor of B in CFG IN(Bi) 34

34 Finding IN(B) and OUT(B) N basic blocks, 2 N sets IN / OUT System with 2 N unknowns Solve by iteracng uncl a fixed point is found How to start iteranon? Safe assumpcon IN[EXIT] = Nothing is very busy at the end IN(B) = U U set of all expressions in program For all B EXIT 35

35 CompuNng very busy expressions IN[EXIT] = IniCalize IN[B] = U for B EXIT while (changes to any IN(B)) { for (each basic block B EXIT) { OUT(B) = Bi, Bi is successor of B in CFG IN(Bi) IN(B) = gen B (OUT(B) kill B ) } } 36

36 Comments Compiler must move code to benefit from very busy expression informanon: code hoisnng if ( ) { tmp1 = j * 4 tmp2 = &A + tmp1 *tmp2 = 0 } else { } tmp3 = j * 4 tmp4 = &A + tmp3 *tmp4 = 1 tmp5 = j * 4 tmp6 = &A + tmp5 if ( ) { *tmp6 = 0 } else { } *tmp6 = 1 38

37 Comments There exists an approach to code monon that deals with all kinds of code monon Loop invariant removal Common sub-expression eliminacon Very busy expression hoiscng together (and also deals with other opnmizanons) and therefore code hoisnng (of busy expressions in isolanon) is not employed in modern compilers. 39

38 9.8 Dataflow problems Forward Backward Reaching definicons Live variables Available expressions Very busy expressions 40

39 Summary for data flow problems Compute two sets for each basic block B SoluCon = OUT(B) / IN(B) Context = IN(B) / OUT(B) Two sets to capture local effects (local_new, local_cut) Define a direccon Reaching definicons, available expressions: Forward Ancestor: predecessor Live variables, very busy expressions: Backward Ancestor: successor Init SoluCon(ENTRY) / SoluCon(EXIT) Init remaining SoluCon sets Define a meet operator Reaching definicons, live variables: Available expressions, very busy expressions: Iterate over basic blocks B Context(B) = Bi, Bi is ancestor of B in CFG SoluCon(Bi) SoluCon(B) = local_new B (Context(B) local_cut B ) 41

40 Compiler implementanon Framework with abstract funcnons to allow specificanon of IniCalizaCon of local_new, local_cut DirecCon Meet (confluence) operator IniCal IN and OUT sets Transfer funccon (depends on direccon) OUT = (IN local_cut) local_gen IN = (OUT local_cut) local_gen Use the framework to instannate specific data flow analyses 42

41 Class hierarchy 43

42 9.9 Code transformanons Compiler uses global dataflow informanon to implement code transformanons Covered only briefly in this class 44

43 9.9.1 Constant folding Need: constant propaganon informanon as discussed in 9.1 Or reaching definicons as discussed in 9.2 TransformaNon: if both operands are constant, compute value in compiler AwenCon: careful if the compiler does not run on target system ( cross-compiler ) Must make sure compiler produces result that would have been obtained at runcme TransformaNon may create new opportunines 45

44 9.9.2 Dead assignment eliminanon Need: live variable analysis Dead assignment: target of store is not live TransformaNon: remove useless assignment statement AssumpCon: Reuse of available expressions Ced to (designated temporary) variables TransformaNon may render other statements dead 46

45 9.9.3 Dead code eliminanon Need: constant propaganon informanon, reaching defininons Dead code: unreachable code For well-structured programs: if-then or if-then-else statements with condicon expressions that can be evaluated at compile Cme TransformaNon: remove unreachable code May render variables dead 47

46 9.9.4 Copy propaganon Various transformanons introduce copies x = a + b x = a + b if (..) { t = x z = a + b if (..) { } z = t y = a + b } y = t 48

47 Copy propaganon May want to eliminate the copies Replace t by x x = a + b x = a + b if (..) { t = x z = a + b if (..) { } z = x y = a + b } y = x Dead assignment eliminanon takes care of t=x 49

48 Copy propaganon May also have beneficial effects on register allocator Given copy stmt S: t = x Compiler can subsntute x for t at point P if 1. DefiniCon S is the only definicon of t that reaches P 2. On every path from S to P there are no assignments to x A path may go through P mulcple Cmes but not go through S a second Cme and scll must sacsfy this condicon CondiNon (1) is easily checked given reaching defininons 50

49 New dataflow problem: reaching copy statements For each basic block B gen B = {copy-stmt copy-stmt a=b appears in B and there is no subsequent definicon of b in B} kill B = {copy-stmt for the copy-stmt a=b there is a definicon of a or b in B (and copy-stmt does not appear a_er these definicons in B)} Note that different assignments (copy statements) a=b kill each other Transfer funcnon IN(B): Set of copies S: a=b such that every path to P before_b contains S and there is no definicon of b subsequent to the last occurrence of S OUT(B): to P a_er_b 51

50 Transfer funcnon OUT (ENTRY) = OUT(B) = U U set of all copy statements in program For all B ENTRY IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) OUT(B) = gen B (IN(B) kill B ) 52

51 Finding reaching copy statements OUT[ENTRY] = IniCalize OUT[B] = U for B ENTRY while (changes to any OUT(B)) { for (each basic block B ENTRY) { } } IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) OUT(B) = gen B (IN(B) kill B ) 53

52 Example S1: x = y B1 B2 S2: y = B3 S3: x = z B4 S4: = x B5 S4: = x 54

53 Example gen = {S1: x=y} kill= {S3: x=z} S1: x = y B1 B2 S2: y = gen = {S3: x=z} kill= {S1: x=y} B3 S3: x = z gen = {} kill= {S1: x=y} B4 S4: = x B5 S4: = x 55

54 Example IN(B2) = IN(B3) = OUT(B1) = { S1: x=y } OUT(B2) = OUT(B3) = IN(B4) = OUT (B4) = { S3: x=z } IN(B5) = OUT(B2) OUT(B4) = Please note that for reaching defininons, the defininon of x in S1 reaches B5 (via B2) 56

55 9.10 must be conservanve Pointers not an issue for JavaLi must be careful if language allows addresses to be taken Risk of aliases Arrays don t include them in data flow computanon No effort to understand modificacon of individual array elements 57

56 Method invocanon Java (and JavaLi) allow only value parameters *and* there is not way to get a reference to a local variable Treat actual parameter as uses of a variable resp. evaluacon of an expression Other languages support pointers (and may have global variables) ret = foo (p1, p2,, pn) Variable ret is defined, p1, p2,, pn are used What is modified by foo? Any parameter pi? LocaCons reachable via pi? Globals? Must make worst-case assumpcon in the absence of bewer informacon 58

57 ConservaNsm int a, *b; d1: a = 3; d2: *b =. P:. For reaching defininons, d1 reaches P Can t be sure that *b writes a For constant propaganon, (a=3) is false at P *b might destroy value of a 59

Compiler Design Spring 2017

Compiler Design Spring 2017 Compiler Design Spring 2017 8.6 Live variables Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation Live variables Foundations for several optimizations If a variable is not live,

More information

Data-flow Analysis. Y.N. Srikant. Department of Computer Science and Automation Indian Institute of Science Bangalore

Data-flow Analysis. Y.N. Srikant. Department of Computer Science and Automation Indian Institute of Science Bangalore Department of Computer Science and Automation Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design Data-flow analysis These are techniques that derive information about the flow

More information

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions Agenda CS738: Advanced Compiler Optimizations Data Flow Analysis Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Static analysis and compile-time

More information

Advanced Compilers Introduction to Dataflow Analysis by Example. Fall Chungnam National Univ. Eun-Sun Cho

Advanced Compilers Introduction to Dataflow Analysis by Example. Fall Chungnam National Univ. Eun-Sun Cho Advanced Compilers Introduction to Dataflow Analysis by Example Fall. 2016 Chungnam National Univ. Eun-Sun Cho 1 Dataflow Analysis + Optimization r1 = r2 + r3 r6 = r4 r5 r6 = r2 + r3 r7 = r4 r5 r4 = 4

More information

Data-flow Analysis - Part 2

Data-flow Analysis - Part 2 - Part 2 Department of Computer Science Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design Data-flow analysis These are techniques that derive information about the flow of data

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

More Dataflow Analysis

More Dataflow Analysis More Dataflow Analysis Steps to building analysis Step 1: Choose lattice Step 2: Choose direction of dataflow (forward or backward) Step 3: Create transfer function Step 4: Choose confluence operator (i.e.,

More information

Lecture 2. Introduction to Data Flow Analysis

Lecture 2. Introduction to Data Flow Analysis Lecture 2 Introduction to Data Flow Analysis I II III Example: Reaching definition analysis Example: Liveness Analysis A General Framework (Theory in next lecture) Reading: Chapter 9.2 Advanced Compilers

More information

Compiler Optimization and Code Generation

Compiler Optimization and Code Generation Compiler Optimization and Code Generation Professor: Sc.D., Professor Vazgen Melikyan 1 Course Overview Introduction: Overview of Optimizations 1 lecture Intermediate-Code Generation 2 lectures Machine-Independent

More information

Why Global Dataflow Analysis?

Why Global Dataflow Analysis? Why Global Dataflow Analysis? Answer key questions at compile-time about the flow of values and other program properties over control-flow paths Compiler fundamentals What defs. of x reach a given use

More information

MIT Introduction to Dataflow Analysis. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

MIT Introduction to Dataflow Analysis. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology MIT 6.035 Introduction to Dataflow Analysis Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Dataflow Analysis Used to determine properties of program that involve multiple

More information

Lecture 4 Introduction to Data Flow Analysis

Lecture 4 Introduction to Data Flow Analysis Lecture 4 Introduction to Data Flow Analysis I. Structure of data flow analysis II. Example 1: Reaching definition analysis III. Example 2: Liveness analysis IV. Generalization What is Data Flow Analysis?

More information

: Compiler Design

: Compiler Design 252-210: Compiler Design 9.0 Data- Flow Analysis Thomas R. Gross Computer Science Department ETH Zurich, Switzerland Global program analysis is a crucial part of all real compilers. Global : beyond a statement

More information

Compiler Structure. Data Flow Analysis. Control-Flow Graph. Available Expressions. Data Flow Facts

Compiler Structure. Data Flow Analysis. Control-Flow Graph. Available Expressions. Data Flow Facts Compiler Structure Source Code Abstract Syntax Tree Control Flow Graph Object Code CMSC 631 Program Analysis and Understanding Fall 2003 Data Flow Analysis Source code parsed to produce AST AST transformed

More information

Control flow and loop detection. TDT4205 Lecture 29

Control flow and loop detection. TDT4205 Lecture 29 1 Control flow and loop detection TDT4205 Lecture 29 2 Where we are We have a handful of different analysis instances None of them are optimizations, in and of themselves The objective now is to Show how

More information

CONTROL FLOW ANALYSES!

CONTROL FLOW ANALYSES! PROGRAMMING LANGUAGES LABORATORY! Universidade Federal de Minas Gerais - Department of Computer Science CONTROL FLOW ANALYSES! PROGRAM ANALYSIS AND OPTIMIZATION DCC888! Fernando Magno Quintão Pereira!

More information

Data Flow Analysis. Program Analysis

Data Flow Analysis. Program Analysis Program Analysis https://www.cse.iitb.ac.in/~karkare/cs618/ Data Flow Analysis Amey Karkare Dept of Computer Science and Engg IIT Kanpur Visiting IIT Bombay karkare@cse.iitk.ac.in karkare@cse.iitb.ac.in

More information

Lecture Compiler Middle-End

Lecture Compiler Middle-End Lecture 16-18 18 Compiler Middle-End Jianwen Zhu Electrical and Computer Engineering University of Toronto Jianwen Zhu 2009 - P. 1 What We Have Done A lot! Compiler Frontend Defining language Generating

More information

ELEC 876: Software Reengineering

ELEC 876: Software Reengineering ELEC 876: Software Reengineering () Dr. Ying Zou Department of Electrical & Computer Engineering Queen s University Compiler and Interpreter Compiler Source Code Object Compile Execute Code Results data

More information

Lecture 6 Foundations of Data Flow Analysis

Lecture 6 Foundations of Data Flow Analysis Lecture 6 Foundations of Data Flow Analysis I. Meet operator II. Transfer functions III. Correctness, Precision, Convergence IV. Efficiency ALSU 9.3 Phillip B. Gibbons 15-745: Foundations of Data Flow

More information

Compiler Passes. Optimization. The Role of the Optimizer. Optimizations. The Optimizer (or Middle End) Traditional Three-pass Compiler

Compiler Passes. Optimization. The Role of the Optimizer. Optimizations. The Optimizer (or Middle End) Traditional Three-pass Compiler Compiler Passes Analysis of input program (front-end) character stream Lexical Analysis Synthesis of output program (back-end) Intermediate Code Generation Optimization Before and after generating machine

More information

Compiler Design. Fall Control-Flow Analysis. Prof. Pedro C. Diniz

Compiler Design. Fall Control-Flow Analysis. Prof. Pedro C. Diniz Compiler Design Fall 2015 Control-Flow Analysis Sample Exercises and Solutions Prof. Pedro C. Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292

More information

Lecture 6 Foundations of Data Flow Analysis

Lecture 6 Foundations of Data Flow Analysis Review: Reaching Definitions Lecture 6 Foundations of Data Flow Analysis I. Meet operator II. Transfer functions III. Correctness, Precision, Convergence IV. Efficiency [ALSU 9.3] Phillip B. Gibbons 15-745:

More information

Example of Global Data-Flow Analysis

Example of Global Data-Flow Analysis Example of Global Data-Flow Analysis Reaching Definitions We will illustrate global data-flow analysis with the computation of reaching definition for a very simple and structured programming language.

More information

Dataflow analysis (ctd.)

Dataflow analysis (ctd.) Dataflow analysis (ctd.) Available expressions Determine which expressions have already been evaluated at each point. A expression x+y is available at point p if every path from the entry to p evaluates

More information

Data Flow Analysis. CSCE Lecture 9-02/15/2018

Data Flow Analysis. CSCE Lecture 9-02/15/2018 Data Flow Analysis CSCE 747 - Lecture 9-02/15/2018 Data Flow Another view - program statements compute and transform data So, look at how that data is passed through the program. Reason about data dependence

More information

A main goal is to achieve a better performance. Code Optimization. Chapter 9

A main goal is to achieve a better performance. Code Optimization. Chapter 9 1 A main goal is to achieve a better performance Code Optimization Chapter 9 2 A main goal is to achieve a better performance source Code Front End Intermediate Code Code Gen target Code user Machineindependent

More information

Lecture 10: Lazy Code Motion

Lecture 10: Lazy Code Motion Lecture : Lazy Code Motion I. Mathematical concept: a cut set II. Lazy Code Motion Algorithm Pass : Anticipated Expressions Pass 2: (Will be) Available Expressions Pass 3: Postponable Expressions Pass

More information

A Bad Name. CS 2210: Optimization. Register Allocation. Optimization. Reaching Definitions. Dataflow Analyses 4/10/2013

A Bad Name. CS 2210: Optimization. Register Allocation. Optimization. Reaching Definitions. Dataflow Analyses 4/10/2013 A Bad Name Optimization is the process by which we turn a program into a better one, for some definition of better. CS 2210: Optimization This is impossible in the general case. For instance, a fully optimizing

More information

Compiler Optimizations. Chapter 8, Section 8.5 Chapter 9, Section 9.1.7

Compiler Optimizations. Chapter 8, Section 8.5 Chapter 9, Section 9.1.7 Compiler Optimizations Chapter 8, Section 8.5 Chapter 9, Section 9.1.7 2 Local vs. Global Optimizations Local: inside a single basic block Simple forms of common subexpression elimination, dead code elimination,

More information

Compiler Design Spring 2017

Compiler Design Spring 2017 Compiler Design Spring 2017 8.0 Data-Flow Analysis Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation Admin issues There will be a code review session next week On Thursday

More information

Compiler Optimization Techniques

Compiler Optimization Techniques Compiler Optimization Techniques Department of Computer Science, Faculty of ICT February 5, 2014 Introduction Code optimisations usually involve the replacement (transformation) of code from one sequence

More information

CS153: Compilers Lecture 17: Control Flow Graph and Data Flow Analysis

CS153: Compilers Lecture 17: Control Flow Graph and Data Flow Analysis CS153: Compilers Lecture 17: Control Flow Graph and Data Flow Analysis Stephen Chong https://www.seas.harvard.edu/courses/cs153 Announcements Project 5 out Due Tuesday Nov 13 (14 days) Project 6 out Due

More information

Data Flow Information. already computed

Data Flow Information. already computed Data Flow Information Determine if Determine if a constant in loop modifies Determine if expression already computed Determine if not used later in program Data Flow Equations Local Information: Gen(B):

More information

Register allocation. Register allocation: ffl have value in a register when used. ffl limited resources. ffl changes instruction choices

Register allocation. Register allocation: ffl have value in a register when used. ffl limited resources. ffl changes instruction choices Register allocation IR instruction selection register allocation machine code errors Register allocation: have value in a register when used limited resources changes instruction choices can move loads

More information

(How Not To Do) Global Optimizations

(How Not To Do) Global Optimizations (How Not To Do) Global Optimizations #1 One-Slide Summary A global optimization changes an entire method (consisting of multiple basic blocks). We must be conservative and only apply global optimizations

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

Compiler Optimizations. Chapter 8, Section 8.5 Chapter 9, Section 9.1.7

Compiler Optimizations. Chapter 8, Section 8.5 Chapter 9, Section 9.1.7 Compiler Optimizations Chapter 8, Section 8.5 Chapter 9, Section 9.1.7 2 Local vs. Global Optimizations Local: inside a single basic block Simple forms of common subexpression elimination, dead code elimination,

More information

Global Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization

Global Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization Lecture Outline Global Optimization Global flow analysis Global constant propagation Liveness analysis Compiler Design I (2011) 2 Local Optimization Recall the simple basic-block optimizations Constant

More information

Intro to dataflow analysis. CSE 501 Spring 15

Intro to dataflow analysis. CSE 501 Spring 15 Intro to dataflow analysis CSE 501 Spring 15 Announcements Paper commentaries Please post them 24 hours before class ApplicaBon paper presentabons Good training for conference talks! Will help go through

More information

Middle End. Code Improvement (or Optimization) Analyzes IR and rewrites (or transforms) IR Primary goal is to reduce running time of the compiled code

Middle End. Code Improvement (or Optimization) Analyzes IR and rewrites (or transforms) IR Primary goal is to reduce running time of the compiled code Traditional Three-pass Compiler Source Code Front End IR Middle End IR Back End Machine code Errors Code Improvement (or Optimization) Analyzes IR and rewrites (or transforms) IR Primary goal is to reduce

More information

Introduction. Data-flow Analysis by Iteration. CSc 553. Principles of Compilation. 28 : Optimization III

Introduction. Data-flow Analysis by Iteration. CSc 553. Principles of Compilation. 28 : Optimization III CSc 553 Principles of Compilation 28 : Optimization III Introduction Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2011 Christian Collberg Computing Data-Flow Info.

More information

CIS 341 Final Examination 4 May 2017

CIS 341 Final Examination 4 May 2017 CIS 341 Final Examination 4 May 2017 1 /14 2 /15 3 /12 4 /14 5 /34 6 /21 7 /10 Total /120 Do not begin the exam until you are told to do so. You have 120 minutes to complete the exam. There are 14 pages

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

Contents of Lecture 2

Contents of Lecture 2 Contents of Lecture Dominance relation An inefficient and simple algorithm to compute dominance Immediate dominators Dominator tree Jonas Skeppstedt (js@cs.lth.se) Lecture / Definition of Dominance Consider

More information

CMSC430 Spring 2009 Midterm 2 (Solutions)

CMSC430 Spring 2009 Midterm 2 (Solutions) CMSC430 Spring 2009 Midterm 2 (Solutions) Instructions You have until 4:45pm to complete the midterm. Feel free to ask questions on the midterm. One sentence answers are sufficient for the ``essay'' questions.

More information

Compilers. Optimization. Yannis Smaragdakis, U. Athens

Compilers. Optimization. Yannis Smaragdakis, U. Athens Compilers Optimization Yannis Smaragdakis, U. Athens (original slides by Sam Guyer@Tufts) What we already saw Lowering From language-level l l constructs t to machine-level l constructs t At this point

More information

Midterm 2. CMSC 430 Introduction to Compilers Fall Instructions Total 100. Name: November 21, 2016

Midterm 2. CMSC 430 Introduction to Compilers Fall Instructions Total 100. Name: November 21, 2016 Name: Midterm 2 CMSC 430 Introduction to Compilers Fall 2016 November 21, 2016 Instructions This exam contains 7 pages, including this one. Make sure you have all the pages. Write your name on the top

More information

Dataflow Analysis. Xiaokang Qiu Purdue University. October 17, 2018 ECE 468

Dataflow Analysis. Xiaokang Qiu Purdue University. October 17, 2018 ECE 468 Dataflow Analysis Xiaokang Qiu Purdue University ECE 468 October 17, 2018 Program optimizations So far we have talked about different kinds of optimizations Peephole optimizations Local common sub-expression

More information

Why Data Flow Models? Dependence and Data Flow Models. Learning objectives. Def-Use Pairs (1) Models from Chapter 5 emphasized control

Why Data Flow Models? Dependence and Data Flow Models. Learning objectives. Def-Use Pairs (1) Models from Chapter 5 emphasized control Why Data Flow Models? Dependence and Data Flow Models Models from Chapter 5 emphasized control Control flow graph, call graph, finite state machines We also need to reason about dependence Where does this

More information

CSE 401 Final Exam. March 14, 2017 Happy π Day! (3/14) This exam is closed book, closed notes, closed electronics, closed neighbors, open mind,...

CSE 401 Final Exam. March 14, 2017 Happy π Day! (3/14) This exam is closed book, closed notes, closed electronics, closed neighbors, open mind,... CSE 401 Final Exam March 14, 2017 Happy π Day! (3/14) Name This exam is closed book, closed notes, closed electronics, closed neighbors, open mind,.... Please wait to turn the page until everyone has their

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

Compiler Design. Fall Data-Flow Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Data-Flow Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz Compiler Design Fall 2015 Data-Flow Analysis Sample Exercises and Solutions Prof. Pedro C. Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292 pedro@isi.edu

More information

Compiler Optimisation

Compiler Optimisation Compiler Optimisation 4 Dataflow Analysis Hugh Leather IF 1.18a hleather@inf.ed.ac.uk Institute for Computing Systems Architecture School of Informatics University of Edinburgh 2018 Introduction This lecture:

More information

CS577 Modern Language Processors. Spring 2018 Lecture Optimization

CS577 Modern Language Processors. Spring 2018 Lecture Optimization CS577 Modern Language Processors Spring 2018 Lecture Optimization 1 GENERATING BETTER CODE What does a conventional compiler do to improve quality of generated code? Eliminate redundant computation Move

More information

Compiler Optimisation

Compiler Optimisation Compiler Optimisation 3 Dataflow Analysis Hugh Leather IF 1.18a hleather@inf.ed.ac.uk Institute for Computing Systems Architecture School of Informatics University of Edinburgh 2018 Introduction Optimisations

More information

The Static Single Assignment Form:

The Static Single Assignment Form: The Static Single Assignment Form: Construction and Application to Program Optimizations - Part 3 Department of Computer Science Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design

More information

We can express this in dataflow equations using gen and kill sets, where the sets are now sets of expressions.

We can express this in dataflow equations using gen and kill sets, where the sets are now sets of expressions. Available expressions Suppose we want to do common-subexpression elimination; that is, given a program that computes x y more than once, can we eliminate one of the duplicate computations? To find places

More information

Dependence and Data Flow Models. (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1

Dependence and Data Flow Models. (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1 Dependence and Data Flow Models (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1 Why Data Flow Models? Models from Chapter 5 emphasized control Control flow graph, call graph, finite state machines We

More information

Midterm 2. CMSC 430 Introduction to Compilers Fall Instructions Total 100. Name: November 11, 2015

Midterm 2. CMSC 430 Introduction to Compilers Fall Instructions Total 100. Name: November 11, 2015 Name: Midterm 2 CMSC 430 Introduction to Compilers Fall 2015 November 11, 2015 Instructions This exam contains 8 pages, including this one. Make sure you have all the pages. Write your name on the top

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

Compiler Construction 2009/2010 SSA Static Single Assignment Form

Compiler Construction 2009/2010 SSA Static Single Assignment Form Compiler Construction 2009/2010 SSA Static Single Assignment Form Peter Thiemann March 15, 2010 Outline 1 Static Single-Assignment Form 2 Converting to SSA Form 3 Optimization Algorithms Using SSA 4 Dependencies

More information

CMSC430 Spring 2014 Midterm 2 Solutions

CMSC430 Spring 2014 Midterm 2 Solutions CMSC430 Spring 2014 Midterm 2 Solutions 1. (12 pts) Syntax directed translation & type checking Consider the following grammar fragment for an expression for C--: exp CONST IDENT 1 IDENT 2 [ exp 1 ] Assume

More information

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Module No. # 10 Lecture No. # 16 Machine-Independent Optimizations Welcome to the

More information

CS 6353 Compiler Construction, Homework #3

CS 6353 Compiler Construction, Homework #3 CS 6353 Compiler Construction, Homework #3 1. Consider the following attribute grammar for code generation regarding array references. (Note that the attribute grammar is the same as the one in the notes.

More information

IR Optimization. May 15th, Tuesday, May 14, 13

IR Optimization. May 15th, Tuesday, May 14, 13 IR Optimization May 15th, 2013 Tuesday, May 14, 13 But before we talk about IR optimization... Wrapping up IR generation Tuesday, May 14, 13 Three-Address Code Or TAC The IR that you will be using for

More information

CSE P 501 Compilers. SSA Hal Perkins Spring UW CSE P 501 Spring 2018 V-1

CSE P 501 Compilers. SSA Hal Perkins Spring UW CSE P 501 Spring 2018 V-1 CSE P 0 Compilers SSA Hal Perkins Spring 0 UW CSE P 0 Spring 0 V- Agenda Overview of SSA IR Constructing SSA graphs Sample of SSA-based optimizations Converting back from SSA form Sources: Appel ch., also

More information

We can express this in dataflow equations using gen and kill sets, where the sets are now sets of expressions.

We can express this in dataflow equations using gen and kill sets, where the sets are now sets of expressions. Available expressions Suppose we want to do common-subexpression elimination; that is, given a program that computes x y more than once, can we eliminate one of the duplicate computations? To find places

More information

Review; questions Basic Analyses (2) Assign (see Schedule for links)

Review; questions Basic Analyses (2) Assign (see Schedule for links) Class 2 Review; questions Basic Analyses (2) Assign (see Schedule for links) Representation and Analysis of Software (Sections -5) Additional reading: depth-first presentation, data-flow analysis, etc.

More information

Dependence and Data Flow Models. (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1

Dependence and Data Flow Models. (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1 Dependence and Data Flow Models (c) 2007 Mauro Pezzè & Michal Young Ch 6, slide 1 Why Data Flow Models? Models from Chapter 5 emphasized control Control flow graph, call graph, finite state machines We

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

COSE312: Compilers. Lecture 20 Data-Flow Analysis (2)

COSE312: Compilers. Lecture 20 Data-Flow Analysis (2) COSE312: Compilers Lecture 20 Data-Flow Analysis (2) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 20 June 6, 2017 1 / 18 Final Exam 6/19 (Mon), 15:30 16:45 (in class) Do not be late. Coverage:

More information

MIT Introduction to Program Analysis and Optimization. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

MIT Introduction to Program Analysis and Optimization. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology MIT 6.035 Introduction to Program Analysis and Optimization Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Program Analysis Compile-time reasoning about run-time behavior

More information

Abstract Interpretation Continued

Abstract Interpretation Continued Abstract Interpretation Continued Height of Lattice: Length of Max. Chain height=5 size=14 T height=2 size = T -2-1 0 1 2 Chain of Length n A set of elements x 0,x 1,..., x n in D that are linearly ordered,

More information

Plan for Today. Concepts. Next Time. Some slides are from Calvin Lin s grad compiler slides. CS553 Lecture 2 Optimizations and LLVM 1

Plan for Today. Concepts. Next Time. Some slides are from Calvin Lin s grad compiler slides. CS553 Lecture 2 Optimizations and LLVM 1 Plan for Today Quiz 2 How to automate the process of performance optimization LLVM: Intro to Intermediate Representation Loops as iteration spaces Data-flow Analysis Intro Control-flow graph terminology

More information

: Compiler Design

: Compiler Design 252-210: Compiler Design 7.2 Assignment statement 7.3 Condi2onal statement 7.4 Loops 7.5 Method invoca2on Thomas R. Gross Computer Science Department ETH Zurich, Switzerland Outline 7.1 Access to operands

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

Compiler Construction 2016/2017 Loop Optimizations

Compiler Construction 2016/2017 Loop Optimizations Compiler Construction 2016/2017 Loop Optimizations Peter Thiemann January 16, 2017 Outline 1 Loops 2 Dominators 3 Loop-Invariant Computations 4 Induction Variables 5 Array-Bounds Checks 6 Loop Unrolling

More information

COMPILER DESIGN - CODE OPTIMIZATION

COMPILER DESIGN - CODE OPTIMIZATION COMPILER DESIGN - CODE OPTIMIZATION http://www.tutorialspoint.com/compiler_design/compiler_design_code_optimization.htm Copyright tutorialspoint.com Optimization is a program transformation technique,

More information

Lecture 21 CIS 341: COMPILERS

Lecture 21 CIS 341: COMPILERS Lecture 21 CIS 341: COMPILERS Announcements HW6: Analysis & Optimizations Alias analysis, constant propagation, dead code elimination, register allocation Available Soon Due: Wednesday, April 25 th Zdancewic

More information

CFG (Control flow graph)

CFG (Control flow graph) CFG (Control flow graph) Class B T12 오지은 200814189 신승우 201011340 이종선 200811448 Introduction to CFG Algorithm to construct Control Flow Graph Statement of Purpose Q & A Introduction to CFG Algorithm to

More information

Problem Score Max Score 1 Syntax directed translation & type

Problem Score Max Score 1 Syntax directed translation & type CMSC430 Spring 2014 Midterm 2 Name Instructions You have 75 minutes for to take this exam. This exam has a total of 100 points. An average of 45 seconds per point. This is a closed book exam. No notes

More information

CS153: Compilers Lecture 23: Static Single Assignment Form

CS153: Compilers Lecture 23: Static Single Assignment Form CS153: Compilers Lecture 23: Static Single Assignment Form Stephen Chong https://www.seas.harvard.edu/courses/cs153 Pre-class Puzzle Suppose we want to compute an analysis over CFGs. We have two possible

More information

More Code Generation and Optimization. Pat Morin COMP 3002

More Code Generation and Optimization. Pat Morin COMP 3002 More Code Generation and Optimization Pat Morin COMP 3002 Outline DAG representation of basic blocks Peephole optimization Register allocation by graph coloring 2 Basic Blocks as DAGs 3 Basic Blocks as

More information

CSE373: Data Structures & Algorithms Lecture 6: Hash Tables

CSE373: Data Structures & Algorithms Lecture 6: Hash Tables Lecture 6: Hash Tables Hunter Zahn Summer 2016 Summer 2016 1 MoCvaCng Hash Tables For a dic$onary with n key, value pairs insert find delete Unsorted linked- list O(1) O(n) O(n) Unsorted array O(1) O(n)

More information

CS 4120 Lecture 31 Interprocedural analysis, fixed-point algorithms 9 November 2011 Lecturer: Andrew Myers

CS 4120 Lecture 31 Interprocedural analysis, fixed-point algorithms 9 November 2011 Lecturer: Andrew Myers CS 4120 Lecture 31 Interprocedural analysis, fixed-point algorithms 9 November 2011 Lecturer: Andrew Myers These notes are not yet complete. 1 Interprocedural analysis Some analyses are not sufficiently

More information

Loop Optimizations. Outline. Loop Invariant Code Motion. Induction Variables. Loop Invariant Code Motion. Loop Invariant Code Motion

Loop Optimizations. Outline. Loop Invariant Code Motion. Induction Variables. Loop Invariant Code Motion. Loop Invariant Code Motion Outline Loop Optimizations Induction Variables Recognition Induction Variables Combination of Analyses Copyright 2010, Pedro C Diniz, all rights reserved Students enrolled in the Compilers class at the

More information

Compiler Design Spring 2018

Compiler Design Spring 2018 Compiler Design Spring 2018 2.3 Templates (for code generation) 2.4 Template-based code generator Thomas R. Gross Computer Science Department ETH Zurich, Switzerland 26 2.3 Templates Templates decide how

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

Compiler Construction 2010/2011 Loop Optimizations

Compiler Construction 2010/2011 Loop Optimizations Compiler Construction 2010/2011 Loop Optimizations Peter Thiemann January 25, 2011 Outline 1 Loop Optimizations 2 Dominators 3 Loop-Invariant Computations 4 Induction Variables 5 Array-Bounds Checks 6

More information

EECS 583 Class 6 Dataflow Analysis

EECS 583 Class 6 Dataflow Analysis EECS 583 Class 6 Dataflow Analysis University of Michigan September 26, 2011 Announcements & Reading Material Today s class» Compilers: Principles, Techniques, and Tools, A. Aho, R. Sethi, and J. Ullman,

More information

Intermediate representation

Intermediate representation Intermediate representation Goals: encode knowledge about the program facilitate analysis facilitate retargeting facilitate optimization scanning parsing HIR semantic analysis HIR intermediate code gen.

More information

301AA - Advanced Programming [AP-2017]

301AA - Advanced Programming [AP-2017] 301AA - Advanced Programming [AP-2017] Lecturer: Andrea Corradini andrea@di.unipi.it Tutor: Lillo GalleBa galleba@di.unipi.it Department of Computer Science, Pisa Academic Year 2017/18 AP-2017-04: Run&me

More information

CS143 Final Spring 2016

CS143 Final Spring 2016 CS143 Final Spring 2016 Please read all instructions (including these) carefully. There are 5 questions on the exam, all with multiple parts. This exam is designed to take 2 hours, but you have the full

More information

CSE443 Compilers. Dr. Carl Alphonce 343 Davis Hall

CSE443 Compilers. Dr. Carl Alphonce 343 Davis Hall CSE443 Compilers Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis Hall Phases of a compiler Target machine code generation Figure 1.6, page 5 of text B1 i = 1 B2 j = 1 B3 t1 = 10 * i t2 = t1 + j t3 = 8

More information

Type checking. Jianguo Lu. November 27, slides adapted from Sean Treichler and Alex Aiken s. Jianguo Lu November 27, / 39

Type checking. Jianguo Lu. November 27, slides adapted from Sean Treichler and Alex Aiken s. Jianguo Lu November 27, / 39 Type checking Jianguo Lu November 27, 2014 slides adapted from Sean Treichler and Alex Aiken s Jianguo Lu November 27, 2014 1 / 39 Outline 1 Language translation 2 Type checking 3 optimization Jianguo

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

EECS 583 Class 6 More Dataflow Analysis

EECS 583 Class 6 More Dataflow Analysis EECS 583 Class 6 More Dataflow Analysis University of Michigan September 24, 2018 Announcements & Reading Material HW 1 due tonight at midnight» Hopefully you are done or very close to finishing Today

More information

Control-Flow Graphs & Dataflow Analysis. CS4410: Spring 2013

Control-Flow Graphs & Dataflow Analysis. CS4410: Spring 2013 Control-Flow Graphs & Dataflow Analysis CS4410: Spring 2013 Past Few Lectures: High-level Intermediate Languages: Monadic Normal Form Optimization as algebraic transformations: 3+4 7, (λx.e) v e[v/x],

More information

Lecture 20 CIS 341: COMPILERS

Lecture 20 CIS 341: COMPILERS Lecture 20 CIS 341: COMPILERS Announcements HW5: OAT v. 2.0 records, function pointers, type checking, array-bounds checks, etc. Due: TOMORROW Wednesday, April 11 th Zdancewic CIS 341: Compilers 2 A high-level

More information