CS 380C: Advanced Compiler Techniques

      Unique id: 55800

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

      TA: Dong Li
      email: dongli@cs.utexas.edu
      Phone: 232-7451
      Office Hours:Every Thursday 2:15--3:15, Desk #1 ENS 31NQ
      Office Hours:The weeks programming assignments are due: Tuesday 2:15--3:15, Desk #1 ENS 31NQ

      AdministrativeAssistant: Tom Horn
      email: tom@ices.utexas.edu
      phone: 471-7511
      office: ACES 4.126

    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 learn to read and critique original research papers.

    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. Five programming assignments provide experience with implementation issues and allow students to evaluate the impact of individual 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 11am on the day of reading assignment. No late critiques accepted. You have 23 readings and due dates from which to choose.
    • 75%: Five programming assignments are due Fridays at 5pm throughout the semester. You may work in groups of two on all assignments. By permission of the instructor, you may replace the last two programming assignments with an original research project that includes an implementation and report. You have seven slip (late) days applied to programming assignments at your discretion. Slip days are counted in twenty four hour increments and accrue to both partners. One hour to 24 hours late is one slip day.

    Ethics

    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.

      "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

    Course Materials

    We will be using source materials (rather than a synthesizing book) in this class. As appropriate, I tried to select 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.

    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