CS 380C: Advanced Compiler Techniques

      Unique id: 54900

      Instructor: Kathryn S. McKinley
      email: mckinley@cs.utexas.edu
      Phone: 232-7467
      Class Hours: 10:00-11:15 Monday & Wednesday, NOTE NEW LOCATION: ACES 3.408
      Office Hours: 9:00-10:00 Wednesday ACES 3.420 and by appointment
      web page: http://www.cs.utexas.edu/users/mckinley/380C

      TA: Hadi Esmaeilzadeh
      email: hadi@cs.utexas.edu
      Phone: 232-7443
      Office Hours:Wed, 1:00-2:00pm, ENS 31NQ
      Office Hours:The weeks that programming assignments are due: Mon, Wed, Fri, 1:00-2:00pm, ENS 31NQ

      AdministrativeAssistant: Gem Naivar
      email: gem@cs.utexas.edu
      phone: 232-7460
      office: ACES 3.422

    Web materials

    All materials (lecture notes, assignments, policies, syllabus, etc.) are available from the course web page:
    http://www.cs.utexas.edu/users/mckinley/380C

      Lecture Schedule and Notes

      Programming Assignments

      Reading critiques

      Student Grades: UTdirect's eGradebook

    Description

    This course studies the construction of optimizing compilers with a focus on uniprocessor architectures. We will cover data-flow analysis, program optimization, and code generation across basic blocks, procedures, and complete programs. We will study classical topics such as dataflow analysis, static-single assignment, interprocedural and intraprocedural analysis, intermediate representations, register allocation, and scheduling in depth and in the context of modern uniprocessors. We will sample some of the key challenges for modern compilers and runtime systems: optimizations for object-oriented languages, just-in-time compilation, garbage collection, dependence analysis, and loop transformations (the later two are the building blocks for optimizing for memory hierarchies and parallel machines).

    This course is experiential. The bulk of your course grade will come from programming assignments that implement program analysis, intermediate representations, and optimizations. You will write critiques of original research papers, which will teach you how to express technical thoughts clearly in your writing and will teach you critical thinking skills.

    Objective

    At the highest level, the goal of this course is to help prepare you to do research. To do original research, you need to go beyond the state-of-the-art. We will therefore read read and evaluate research papers. All researchers need these skills. As a general rule in systems research, you must implement your ideas and evaluate them. We will therefore implement program analyses and optimizations and evaluate them. Even if you do not plan on doing research in systems, these skills are likely to assist your research efforts. At a technical level, you will learn about compilation techniques for obtaining high performance on modern computer architectures. Analysis and optimization techniques are presented in class lectures. Four programming assignments provide experience with implementation and evaluation of compilation techniques.

    Prerequisites

    An undergraduate compiler course or permission of instructor. Programming experience in the context of a larger system is helpful.

    Grading

    • 5%: Attendance, class participation
    • 20%: Written critique of 10 readings. Due in class at 10am on the day of reading assignment. No late critiques accepted. You have 23 readings and due dates from which to choose.
    • 75%: Four programming assignments are due Fridays at 5pm throughout the semester. You are encouraged to work in groups of two on all assignments. See the Programming Assignments Policies document for more details.

    Ethics

      "Your code is like your boyfriend or girlfriend. It's okay to talk about it on an abstract, high level. But you don't want to go into the specific details, and you certainly don't want to share." Pascal Van Hentenryck, Computer Science Professor, Brown University, 1997

    As a scientist, you are expected to maintain the highest ethical standards, do your own work, report on it accurately, and acknowledge any assistance.

    Feel free to discuss lectures, reading, and assignments with me, the TA, and other members of the class. You may discuss design, approach, debugging, and testing. You may not copy code, use code from previous semesters, use code you find on the Internet, read code written by other people, or debug code written by other people. Turning in any work that is not original will be reported to the University and at a minimum, you will fail the course.

    The Student Code of Conduct documents your rights and responsibilities as a student.

    Course Materials

    We will be using source materials (rather than a synthesizing book). As appropriate, I have selected the first, best, or easiest to understand research publication on a topic. If you would like a supplementary book for lengthier explanations and examples, I recommend any of the following:

    • Keith D Cooper and Linda Torczon, Engineering a Compiler, Morgan Kaufmann.
    • Steven Muchnick, Advanced Compiler Design Implementation, Morgan Kaufmann.
    • Aho, Lam, Sethi and Ullman, Compilers: Principles, Techniques and Tools, 2/E Addison-Wesley, 2007.
    • Randy Allen & Ken Kennedy, Optimizing Compilers for Modern Architectures, Morgan Kaufmann.
    • Michael Wolfe, High Performance Compilers for Parallel Computing, , Addison-Wesley.

    These books are available in the UT library or you may purchase them. Topics

    1. Introduction
        compiler structure, architecture and compilation, sources of improvement
    2. Control flow analysis
        basic blocks & loops
    3. Data flow analysis and optimizations
        bit vectors, iterative frameworks, interval analysis, reaching definitions, liveness, common subexpression elimination, constant propagation
    4. More control flow analysis
        dominators, control dependence
    5. Static-single assignment
        static-single assignment, constant propagation
    6. Scalar optimization
        loop invariant code motion, common subexpression elimination, strength reduction, dead code elimination, loop optimizations, etc.
    7. Instruction scheduling
        pipelined architectures, delayed-load architectures, list scheduling
    8. Register allocation
        coloring, allocation, live range splitting.
    9. Performance evaluation
        what do your results mean?
    10. Interprocedural analysis
        side effects, flow-insensitive, flow-sensitive, constants, inlining
    11. Alias analysis
        alias analysis, method resolution
    12. Data dependence analysis
        dependence testing, dependence graphs
    13. Loop transformations
        interchange, tiling, fusion, distribution, splitting
    14. Just-in-time compilation
        fast global optimization
    15. Garbage collection
        automatic memory management and data locality
    16. EDGE architecture compilation
        more resources, scheduling is hard


    Kathryn S. McKinley