Fall 2011 coee break rule compilaon of a reasonable

Info icon This 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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern