Lecture2 - Overview of Compilers Static & Dynamic CSE 501...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Overview of Compilers CSE 501 Lecture 2 April 1, 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Questions? Programming assignments? Reading? Web site http://cs.washington.edu/501/ Mailing list [email protected]
Background image of page 2
A Compiler compiler source language target language Any language to any language (contrast with interpreter )
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Separation of Concerns As a matter of engineering, it's a bad idea to try and build a monolithic compiler. Instead, we separate our concerns. front end source language target language back end intermediate language Intermediate language (IL) = Intermediate representation (IR)
Background image of page 4
The UNCOL Problem IL TL 1 BE 1 TL 2 BE 2 FE 1 SL 1 FE 2 SL 2 FE 3 SL 3
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An Optimizing Compiler FE SL TL BE IL IL optimizer Naturally, we might imagine multiple front ends and back ends sharing the same optimizer. Notice that the optimizer looks just like a compiler. We might have many optimizers and/or a variety of ILs.
Background image of page 6
Optimization • An optimizer tries to • Eliminate overhead from language abstractions • Map source program onto target language (e.g., hardware) efficiently • Equal the efficiency of a good target-language programmer An optimizer might have any one of a number of goals • Fastest code • Smallest code • Code with the fewest page/cache misses
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Expectations A compiler ought to provide robust optimization • Small changes in the input should not produce wild changes in the output • Create an expectation of excellent code quality • Broaden the set of inputs that produce good code We'd like to attain a large fraction of peak performance (not 5%) Some inputs have always produced good code • The 1st Fortran compiler focused on DO loops • PCC did well on assembly-like programs
Background image of page 8
Engineering Good optimizing compilers are crafted, not just assembled
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2012 for the course CSE 403 taught by Professor Staff during the Spring '08 term at University of Washington.

Page1 / 19

Lecture2 - Overview of Compilers Static & Dynamic CSE 501...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online