CMPUT680 - Winter 2006 Topic0: Introduction José Nelson Amaral http://www.cs.ualberta.ca/~amaral/courses/680 CMPUT 680 - Compiler Design and Optimization 1 Admin. Information Instructor: Office Phone Office Hours: Prof. Jose Nelson Amaral ATH 342 492-5411 Anytime (appointment suggested but not required) amaral@cs.ualberta.ca email: webpage: http://www.cs.ualberta.ca/~amaral/courses/680 CMPUT 680 - Compiler Design and Optimization 2 Some People You Want to be Friend With Paul Berube Kit Barton Stephen Curial CMPUT 680 - Compiler Design and Optimization Zhuang Guo 3 Mailing List Important announcements will be made through the class mailing list (some only in the list). I have created an alias for the students in CMPUT 680. If you have not received an email from me, please send me an email. CMPUT 680 - Compiler Design and Optimization 4 Bibliography 1. A set of papers - to be assigned 2. Books: Randy Allen, Ken Kennedy, Optimizing Compilers for Modern Architectures: A Dependence-based Approach, Morgan Kauffman, 2001. Andrew W. Appel : Modern Compiler Implementation in C A. Aho, R. Sethi and J. Ullman, Compilers: Principles, Techniques and Tools (The Dragon Book), Addison Wesley, 1988 M. Wolfe, High Performance Compilers of Parallel Computing, Addison Wesley, 1995 S. Muchnick, Advanced Compiler Design and Implementation, Morgan Kaufman, 1997 CMPUT 680 - Compiler Design and Optimization 5 Bibliography CMPUT 680 - Compiler Design and Optimization 6 Bibliography 3. Journals IEEE ACM JPDC JSC JPP PC JPL Computer Transactions on Computers Concurrency Transactions on Parallel and Distributed Systems TOPLAS - Transactions on Programming Languages and Systems Transaction on Computer Systems Journal of Parallel and Distributed computing Journal of Supercomputing International Journal of Parallel Programming Parallel Computing (North-Holland) J. of Programming Languages CMPUT 680 - Compiler Design and Optimization 7 Bibliography 4. Conference Proceedings PLDI ACM Symposium on Programming Language Design and Implementation POPL ACM Symposium on Principles of Programming Languages PPOPP ACM Symposium on Principles and Practice of Parallel Programming ICPP International Conference on Parallel Processing ICS International Conference on Supercomputing LCPC Intern. WS. on Languages and Compilers for Parallel Computing PACT Parallel Architectures and Compilation Techniques (since 1994) IPPS International Parallel Processing Symposium EUROPAR European Parallel Processing Conferences MICRO ACM/IEEE Symposium on Microarchitectures ISCA ACM/IEEE International Symposium on Computer Architecture ASPLOS ACM Symposium on Architecture Support for Program Languages and Operating Systems CMPUT 680 - Compiler Design and Optimization 8 Resident Compiler Compiler Development Test Cycle Development Compiler Source Code Development Compiler Application Output Verifier Application Source Code Expected Application Output Application Output Compiled Application Application Input Structure of an Optimizing Compiler source code compiler front-end intermediate code loop optimization register allocation code generation code scheduling machine code CMPUT 680 - Compiler Design and Optimization 10 Phases of a Compiler Source program Intermediate-code Generator Lexical Analyzer (Scanner) Non-optimized Intermediate Code Tokens Intermediate-code Optimizer Syntax Analyzer (Parser) Optimized Intermediate Code Parse tree Semantic Analyzer Target-code Generator CMPUT 680 - Compiler Design Abstract Syntax Tree w/ Attributes and Optimization Target machine code 11 Low-level Model Mixed-level Model String of characters Lexical analyzer String of characters Lexical analyzer String of tokens Parser String of tokens Parser Parse tree Semantic analyzer Parse tree Semantic analyzer Abstract Syntax tree Intermediate-code generator Abstract syntax tree Translator Medium-level intermediate code Low-level intermediate code Optimizer Optimizer Medium-level intermediate code Low-level intermediate code Final assembly Relocatable object module or runnable machine code Code generator Low-level intermediate code Postpass optimizer Relocatable object module or runnable machine code Two models of compiler structures (Muchnick, pp. 08) 2. Lexical Analysis 3. Parsing 4. Abstract Syntax 6. Activation Records 7. Translation to Intermediate Code 5. Semantic Analysis 8. Basic Blocks and traces 9. Instruction Selection 1. Introduction 10. Liveness Analysis 12. Putting it All Together 11. Register Allocation 17. Dataflow Analysis 18. Loop Optimizations 19. Static SingleAssignment Form 15. Functional Languages 16. Polymorphic Types 20. Pipelining, Scheduling 13. Garbage Collection 14. Object-Oriented Languages 21. Memory Hierarchies Course Teaching Sequence (Appel, pp. x) 2. Lexical Analysis 3. Parsing 4. Abstract Syntax 6. Activation Records 7. Translation to Intermediate Code 5. Semantic Analysis 8. Basic Blocks and traces 9. Instruction Selection 1. Introduction 10. Liveness Analysis 12. Putting it All Together 11. Register Allocation 17. Dataflow Analysis 18. Loop Optimizations 19. Static SingleAssignment Form 15. Functional Languages 16. Polymorphic Types 20. Pipelining, Scheduling 13. Garbage Collection 14. Object-Oriented Languages 21. Memory Hierarchies Course Teaching Sequence (Appel, pp. x) Instruction Selection Assembler Assem Canonicalize Relocatable Object Code IR Trees Translate IR Trees Semantic Analysis Translate Tables Code Emission Linker Machine Language Register Allocation Assembly Language Frame Frame Layout Register Assignment Data Flow Analysis Abstract Syntax Parsing Actions Interference Graph Control Flow Analysis Reductions Parse Flow Graph Token Lex Assem Source Program Environments Phases of a compiler, and interfaces between them (Appel, pp. 4)