Fall 2011 coee break rule compilaon of a reasonable

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: piler Lecture 1 Lecture 1 Course –  General Course Mechanics Mechanics erformance rule: Compile @me is important, but p of executable o"en more important. Bindings ML Variable ML Variable Bindings –  Typical use case is compile few @mes, run many @mes. Grossman –  So make choices tGrossman Danompile @me, as long as Dan hat improve c Fall 2011 they don’t impact performance of generated code. Fall 2011 –  “Coffee Break Rule”: [email protected] of a reasonable sized code shouldn’t take longer than an average coffee break, or customers will complain. Winter 2013 UW CSE 401 (Michael Ringenburg) 6 IR Design CSE341: Programming CSE341: Programming Languages Languages •  Desirable [email protected] –  Easy to generate Lecture 1 Lecture 1 Course –  Easy to manipulate Course Mechanics Mechanics ML Variable Bindings –  Expressive Variable Bindings ML –  Appropriate level of [email protected] Dan Grossman Dan Grossman •  Different tradeoffs depending alln compiler goals F o 2011 Fall 2011 •  Different tradeoffs in different parts of the same compiler –  Leads to different IRs in different parts. Winter 2013 UW CSE 401 (Michael Ringenburg) 7 IR Design Dimensions CSE341: Programming CSE341: Programming Languages Languages •  Structure Lecture 1 Lecture 1 –  Graphical (trees, graphs, etc.) Course Course Mechanics Mechanics –  Linear (code for some abstract machine) ML Variable Bindings ML Variable Bindings –  Hybrids are common (e.g., control- flow graphs Dan Grossman Dan Grossman with linear code in basic blocks) Fall 2011 Fall 2011 •  [email protected] Level –  High- level, near to source language –  Low- level, closer to machine, more exposed to compiler Winter 2013 UW CSE 401 (Michael Ringenburg) 8 Example: Array Reference CSE341: Programming CSE341: Programming Languages Languages ecture 1 Lecture 1 LLow- level linear (3 address): Course loadI 1 Course Mechanics Mechanics => r1! ML Variable Bindings=> r2! sub rj,r1 ML Variable Bindings Source: A[i,j] AST: subscript A i j loadI 10 Dan Grossman Fall 2011 High level linear: t1 ß། A[i,j] Winter 2013 => r3! sub add loadI add load => => => => => Dan Grossman mult r2,r3 => r4! Fall 2011 ri,r1 r4,r5 @A r7,r6 r8 r5! r6! r7! r8! r9! UW CSE 401 (Michael Ringenburg) 9 Levels of [email protected] CSE341: Programming Languages CSE341: •  Key design Programming Languages to expose decision: how much detail Lecture p Lecture f –  Affects possibility and 1 rofitability o1 various Course Course [email protected]@ons Mechanics Mechanics ML Variable Bindings ML on phase: [email protected] Analysis, some [email protected]@ons •  Depends VariableSBindings prefer high level. Other [email protected]@ons, resource [email protected], Dan Grossman Dan Grossman code [email protected] prefer low level. Fall 2011 Fall 2011 –  Most high- level IRs are graphical •  But graphical IRs are also used with low- level – ...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online