advanced compilers cmpsci 710 spring 2004 lecture 1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 PowerPoint Presentation
Download Presentation
Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1

Loading in 2 Seconds...

play fullscreen
1 / 15

Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1. Emery Berger University of Massachusetts, Amherst. Overview. Class format: Participatory & interactive You take notes, read book & papers Course website: www.cs.umass.edu/~emery/cmpsci710/ Grades: 10% class participation

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1' - skyla


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
advanced compilers cmpsci 710 spring 2004 lecture 1

Advanced CompilersCMPSCI 710Spring 2004Lecture 1

Emery Berger

University of Massachusetts, Amherst

overview
Overview
  • Class format:
    • Participatory & interactive
    • You take notes, read book & papers
  • Course website:
    • www.cs.umass.edu/~emery/cmpsci710/
  • Grades:
    • 10% class participation
    • 10% homework assignments
    • 40% exams
    • 40% project
  • Materials:
    • Muchnick, Advanced Compiler Design Implementation (ACDI)
    • Selected papers
project stuff
Project Stuff
  • 1 to 2 person teams
  • Implement optimization/analysis in:
    • Jikes RVM (IBM’s research Java compiler)
    • Shark (UMass fast & safe scripting language)
    • Others subject to my approval
  • Due dates (roughly)
    • 02/11/04: One-page project description.
    • 02/25/04: 2-4 page project design.
    • 03/25/04: Project implementation review.
    • 04/29/04: Implementation due.
    • 05/06-13/04: In-class presentations.
    • 05/13/04: Project report.
class topics
Class Topics
  • Some bread & butter analyses & optimizations
    • Control flow
    • Data flow analysis & implementation
    • SSA form
    • Register allocation
    • Instruction scheduling
    • Pointer analysis
  • Runtime systems (compiler must be aware of these!)
  • Advanced topics (TBD)
    • Binary decision diagrams for pointer analysis
    • Program slicing
    • Error detection
    • Run time system interaction
    • Region analysis…
what are compilers anyway
What are Compilers, Anyway?
  • Compiler: translates program in one language to executable program in other language
    • Typically lowers abstraction level
      • E.g., Java/C++ to assembler
  • Optimizing compiler:
    • Misnomer!
      • Optimal compilation intractable
    • Improves program performance
performance anxiety
Performance Anxiety
  • But does performance really matter?
    • Computers are really fast
    • Moore’s law (roughly):hardware performance doubles every 18 months
  • Real bottlenecks lie elsewhere:
    • Disk
    • Network
    • Human! (think interactive apps)
      • At most 120 cps typing
      • Waste time “thinking”
compilers don t help much
Compilers Don’t Help Much
  • Do compilers improve performance anyway?
    • Proebsting’s law(Todd Proebsting, Microsoft Research):
      • Difference between optimizing and non-optimizing compiler ~ 4x
      • Assume compiler technology represents 36 years of progress (actually more)
    • Compilers double program performance every 18 years!
      • Not quite Moore’s Law…
argumentum ad absurdum
Argumentum Ad Absurdum
  • Compilers don’t help much(Proebsting’s Law)
    • Don’t use optimizer
  • Computers are getting faster(Moore’s Law)
    • Buy a new one – helps the economy too!
    • Or: wait until one’s fast enough,then run program
  • Hmmm…
a big but
A Big BUT
  • Why use high-level languages anyway?
    • Easier to write & maintain
    • Safer (think Java)
    • More convenient (think libraries, GC…)
  • But: people will not accept massive performance hit for these gains
    • Compile with optimization!
    • Still use C and C++!!
    • Hand-optimize their code!!!
    • Even write assembler code (gasp)!!!!
  • Apparently performance does matter…
why compilers matter1
Why Compilers Matter
  • Key part of compiler’s job:make the costs of abstraction reasonable
    • Remove performance penalty for:
      • Using objects
      • Safety checks (e.g., array-bounds)
      • Writing clean code (e.g., recursion)
  • Use program analysis to transform code: primary topic of this course
analysis the holy grail
Analysis & The Holy Grail
  • Other great uses for program analysis:
    • Static error-checking
      • Detect information leaks
      • Avoid security holes
    • Informing runtime system (e.g., GC)
    • Even better optimizations!
      • E.g., locality-improving transformations (“memory wall”)
  • Holy Grail for compiler research:
    • Programmer: writes simple but O(2^n) algorithm
    • Compiler: changes it to O(n log n) (or O(1)!)
levels of analysis
Levels of Analysis

(in order of increasing detail & complexity)

  • Local (single-block) [1960’s]
    • Straight-line code
    • Simple to analyze; limited impact
  • Intraprocedural [1970’s – today]
    • Whole procedure
    • Dataflow & dependence analysis
  • Interprocedural [late 1970’s – today]
    • Whole-program analysis
    • Tricky:
      • Very time and space intensive
      • Hard for some PL’s (e.g., Java)
optimization analysis transformation
Optimization =Analysis + Transformation
  • Key analyses:
    • Control-flow
      • if-statements, branches, loops, procedure calls
    • Data-flow
      • definitions and uses of variables
  • Representations:
    • Control-flow graph
    • Control-dependence graph
    • Def/use, use/def chains
    • SSA (Static Single Assignment)
next time
Next Time
  • Read ACDI Chapters 1, 2, 7