UG3 Compiling Techniques Overview of the Course

Similar documents
Overview of the Class

Overview of the Class

Overview of the Course

Compiling Techniques

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Compiler Design. Dr. Chengwei Lei CEECS California State University, Bakersfield

Compiler Architecture for High-Performance Problem Solving

Generation of High Performance Domain- Specific Languages from Component Libraries. Ken Kennedy Rice University

CS 526 Advanced Topics in Compiler Construction. 1 of 12

CS426 Compiler Construction Fall 2006

Compilers and Run-Time Systems for High-Performance Computing

Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit

Component Architectures

CSCI 565 Compiler Design and Implementation Spring 2014

High Performance Computing. Without a Degree in Computer Science

Compilers for High Performance Computer Systems: Do They Have a Future? Ken Kennedy Rice University

ECE573 Introduction to Compilers & Translators

Intermediate Representations

Compilers. Computer Science 431

Register Allocation. Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice.

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

Advanced Compiler Construction

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

The View from 35,000 Feet

Compiler Theory Introduction and Course Outline Sandro Spina Department of Computer Science

The Processor Memory Hierarchy

Lexical Analysis - An Introduction. Lecture 4 Spring 2005 Department of Computer Science University of Alabama Joel Jones

Runtime Support for Algol-Like Languages Comp 412

CS 406/534 Compiler Construction Putting It All Together

Parsing III. CS434 Lecture 8 Spring 2005 Department of Computer Science University of Alabama Joel Jones

Runtime Support for OOLs Object Records, Code Vectors, Inheritance Comp 412

Welcome. Orientation to online CPS102 Computer Science 2 (Java 2)

Topics on Compilers

Instruction Selection: Preliminaries. Comp 412

Compiling Techniques

Grammars. CS434 Lecture 15 Spring 2005 Department of Computer Science University of Alabama Joel Jones

Lexical Analysis. Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice.

Compilers and Interpreters

G.PULLAIH COLLEGE OF ENGINEERING & TECHNOLOGY

LCPC Arun Chauhan and Ken Kennedy

Syntax Analysis, V Bottom-up Parsing & The Magic of Handles Comp 412

CSEP 501 Compilers. Overview and Administrivia Hal Perkins Winter /8/ Hal Perkins & UW CSE A-1

Principles of Compiler Construction ( )

Code Merge. Flow Analysis. bookkeeping

Instruction Selection, II Tree-pattern matching

Introduction & First Content Comp 412

Welcome to. Instructor Marc Pomplun CS 470/670. Introduction to Artificial Intelligence 1/26/2016. Spring Selectivity in Complex Scenes

Principles of Compiler Construction ( )

Academic Formalities. CS Language Translators. Compilers A Sangam. What, When and Why of Compilers

Intermediate Representations

Code Shape Comp 412 COMP 412 FALL Chapters 4, 5, 6 & 7 in EaC2e. source code. IR IR target. code. Front End Optimizer Back End

Spring 2016 :: CSE 502 Computer Architecture. Introduction. Nima Honarmand

First, the need for parallel processing and the limitations of uniprocessors are introduced.

CS415 Compilers. Procedure Abstractions. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

ECE : Fundamentals of Wireless Networking - Spring 2007

Syntax Analysis, III Comp 412

CSE 401/M501 Compilers

Software Architecture in Practice

CS415 Compilers. Intermediate Represeation & Code Generation

CMPUT 391 Database Management Systems. Fall Semester 2006, Section A1, Dr. Jörg Sander. Introduction

CS 525 Advanced Database Organization - Spring 2017 Mon + Wed 1:50-3:05 PM, Room: Stuart Building 111

CS535: Interactive Computer Graphics

CSC6290: Data Communication and Computer Networks. Hongwei Zhang

Introduction to Computer Systems

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CS Compiler Construction West Virginia fall semester 2014 August 18, 2014 syllabus 1.0

Lecture 1: Introduction

Combining Optimizations: Sparse Conditional Constant Propagation

Chapters 1 & 2 Programming and Programs

The Software Stack: From Assembly Language to Machine Code

Object-Oriented Programming for Managers

CS 132 Compiler Construction

CS415 Compilers. Lexical Analysis

Compiler Construction LECTURE # 1

Local Register Allocation (critical content for Lab 2) Comp 412

Overview. COMP 506 Rice University Spring target code. source code Front End Optimizer Back End

Question Marks 1 /12 2 /6 3 /14 4 /8 5 /5 6 /16 7 /34 8 /25 Total /120

Lecture 1. CMSC 412 S17 (lect 1)

When and Where? Course Information. Expected Background ECE 486/586. Computer Architecture. Lecture # 1. Spring Portland State University

Administrivia. Compilers. CS143 10:30-11:50TT Gates B01. Text. Staff. Instructor. TAs. The Purple Dragon Book. Alex Aiken. Aho, Lam, Sethi & Ullman

Computing Inside The Parser Syntax-Directed Translation. Comp 412 COMP 412 FALL Chapter 4 in EaC2e. source code. IR IR target.

Program Analysis And Its Support in Software Development

Academic Course Description. EM2101 Computer Architecture

Parallel Programming. Michael Gerndt Technische Universität München

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

Parsing Part II (Top-down parsing, left-recursion removal)

PLAGIARISM. Administrivia. Compilers. CS143 11:00-12:15TT B03 Gates. Text. Staff. Instructor. TAs. Office hours, contact info on 143 web site

Generating Code for Assignment Statements back to work. Comp 412 COMP 412 FALL Chapters 4, 6 & 7 in EaC2e. source code. IR IR target.

Handling Assignment Comp 412

Compiler Construction

CS Understanding Parallel Computing

CSE : PARALLEL SOFTWARE TOOLS

CSE 582 Autumn 2002 Exam 11/26/02

Procedure and Function Calls, Part II. Comp 412 COMP 412 FALL Chapter 6 in EaC2e. target code. source code Front End Optimizer Back End

Arrays and Functions

CS/SE 153 Concepts of Compiler Design

Introduction to Programming Languages and Compilers. CS164 11:00-12:30 TT 10 Evans. UPRM ICOM 4029 (Adapted from: Prof. Necula UCB CS 164)

CS 307: Software Engineering. Lecture 10: Software Design and Architecture

Global Register Allocation via Graph Coloring

Transcription:

UG3 Compiling Techniques Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit permission to make copies of these materials for their personal use.

Critical Facts Welcome to UG3 Compiling Techniques Topics in the design of programming language translators, including parsing, run-time storage management, error recovery, code generation, and optimization Instructor: Dr. Björn Franke (bfranke@inf.ed.ac.uk) Office Hours: Monday 2 PM to 3 PM, JCMB 2414 Text: Keith Cooper & Linda Torczon - Engineering a Compiler Morgan-Kaufmann, ISBN 1-55860-698-X Textbook can be reused in UG4 Compiler Optimisation course Web Site: http://www.inf.ed.ac.uk/teaching/courses/ct/ Coursework, slides (2 per page), practice exams, I will not have handouts in class; get them from the web Slides: Closely based on Keith Cooper s slides Selection of approx. 15 out of >35 lectures Dropped optimisation, smaller amount of in-depth material

Basis for Grading Exams Final 75% Coursework Lexer & Parser 12.5% Dataflow Analysis 12.5%

Rough Syllabus Overview 1 Local Register Allocation 13.2 Scanning 2 Parsing 3 Context Sensitive Analysis 4 Inner Workings of Compiled Code 6, 7 Introduction to Optimization 8 Code Selection 11 Instruction Scheduling 12 Register Allocation 13 More Optimization (time permitting) If it looks like the course follows the text, that s because the text was written from the course. What about the missing chapters? 5 : We ll fit it in 9, 10: see UG4 Compiler Optimisation

Class-taking technique for Compiling Techniques I will use projected material extensively I will moderate my speed, you sometimes need to say STOP You should read the book Not all material will be covered in class Book complements the lectures You are responsible for material from class The exam will cover both lecture and reading I will probably hint at good test questions in class Compiling Techniques is not a programming course Coursework is graded on functionality and documentation more than style (results matter)

Compilers What is a compiler?

Compilers What is a compiler? A program that translates an executable program in one language into an executable program in another language The compiler should improve the program, in some way What is an interpreter?

Compilers What is a compiler? A program that translates an executable program in one language into an executable program in another language The compiler should improve the program, in some way What is an interpreter? A program that reads an executable program and produces the results of executing that program

Compilers What is a compiler? A program that translates an executable program in one language into an executable program in another language The compiler should improve the program, in some way What is an interpreter? A program that reads an executable program and produces the results of executing that program C is typically compiled, Scheme is typically interpreted Java is compiled to bytecodes (code for the Java VM) which are then interpreted Or a hybrid strategy is used Just-in-time compilation

Taking a Broader View Compiler Technology = Off-Line Processing Goals: improved performance and language usability Making it practical to use the full power of the language Trade-off: preprocessing time versus execution time (or space) Rule: performance of both compiler and application must be acceptable to the end user Examples Macro expansion PL/I macro facility 10x improvement with compilation

Taking a Broader View Compiler Technology = Off-Line Processing Goals: improved performance and language usability Making it practical to use the full power of the language Trade-off: preprocessing time versus execution time (or space) Rule: performance of both compiler and application must be acceptable to the end user Examples Macro expansion PL/I macro facility 10x improvement with compilation Database query optimization

Taking a Broader View Compiler Technology = Off-Line Processing Goals: improved performance and language usability Making it practical to use the full power of the language Trade-off: preprocessing time versus execution time (or space) Rule: performance of both compiler and application must be acceptable to the end user Examples Macro expansion PL/I macro facility 10x improvement with compilation Database query optimization Emulation acceleration TransMeta code morphing

Why Study Compilation? Compilers are important system software components They are intimately interconnected with architecture, systems, programming methodology, and language design Compilers include many applications of theory to practice Scanning, parsing, static analysis, instruction selection Many practical applications have embedded languages Commands, macros, formatting tags Many applications have input formats that look like languages, Matlab, Mathematica Writing a compiler exposes practical algorithmic & engineering issues Approximating hard problems; efficiency & scalability

Intrinsic interest Compiler construction involves ideas from many different parts of computer science Artificial intelligence Algorithms Theory Systems Architecture Greedy algorithms Heuristic search techniques Graph algorithms, union-find Dynamic programming DFAs & PDAs, pattern matching Fixed-point algorithms Allocation & naming, Synchronization, locality Pipeline & hierarchy management Instruction set use

Intrinsic merit Compiler construction poses challenging and interesting problems: Compilers must do a lot but also run fast Compilers have primary responsibility for run-time performance Compilers are responsible for making it acceptable to use the full power of the programming language Computer architects perpetually create new challenges for the compiler by building more complex machines Compilers must hide that complexity from the programmer Success requires mastery of complex interactions

Making Languages Usable It was our belief that if FORTRAN, during its first months, were to translate any reasonable scientific source program into an object program only half as fast as its hand-coded counterpart, then acceptance of our system would be in serious danger... I believe that had we failed to produce efficient programs, the widespread use of languages like FORTRAN would have been seriously delayed. John Backus

About the instructor My own research Compiling for embedded processors Optimisation for embedded systems (space, power, speed) Source-level transformation Adaptive compilation Parallelisation for multi-core embedded systems Homogeneous targets, e.g. Multi-DSP Heterogeneous targets, e.g. Systems-on-Chip Design Space Exploration Architecture & Compiler Synthesis Thus, my interests lie in Quality of generated code Interplay between application, compiler and architecture

Next class The view from 35,000 feet How a compiler works What I think is important What is hard and what is easy