Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Last Lecture COMP 512 Rice University Houston, Texas Fall 2003

Similar presentations


Presentation on theme: "The Last Lecture COMP 512 Rice University Houston, Texas Fall 2003"— Presentation transcript:

1 The Last Lecture COMP 512 Rice University Houston, Texas Fall 2003
Copyright 2003, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled in Comp 512 at Rice University have explicit permission to make copies of these materials for their personal use.

2 Putting It All Together
Key questions that a compiler writer must answer? What should the optimizer & back end do? How should the compiler represent the program? Broad answers Figure out what the real problems are Learn everything you can about the target machine Attack each problem with a specific plan Separate concerns as long as possible COMP 512, Fall 2003

3 Lessons Experience is a tough teacher
Understand what the code looks like On input to the compiler and on output from the compiler Hard to see problems in large procedures A good compiler need not do everything Study the code & figure out what’s needed Do those things well & do them thoroughly Hand simulation before implementation pays off Avoid implementing things that solve no problem Find the right level of abstraction for each optimization Constant propagation can be done at source level Redundancy elimination should be done at a low-level COMP 512, Fall 2003

4 Lessons Experience is a tough teacher
Intermediate representations are important Determines level of exposed detail Every pass traverses it, so efficient manipulation is critical Code shape and name spaces are important Determine opportunities & size of data structures Has large impact on effectiveness of algorithms Compile-time space counts Limits size of procedures that can be compiled Compiler touches all that space More complex analyses take lots of space COMP 512, Fall 2003

5 { Lessons Experience is a tough teacher
Separation of concerns is vital to progress Resource constraints from rearrangement Allocation from optimization Parsing from code generation Separation of concerns interferes with optimization Allocation & scheduling Evaluation order & redundancy elimination Code shape decisions affect later passes { Loop shape, case stmts. Annotations (ILOC tags) COMP 512, Fall 2003

6 And that’s the end of our story ...
Comp 512 And that’s the end of our story ... COMP 512, Fall 2003


Download ppt "The Last Lecture COMP 512 Rice University Houston, Texas Fall 2003"

Similar presentations


Ads by Google