Overview of the CourseSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Taking a Broader ViewSlide 12Slide 13Slide 14Aren’t compilers a solved problem?Slide 16Slide 17Slide 18Overview of the CourseCritical FactsWelcome to CISC 672 — Advanced Compiler Construction•Instructor: Dr. John Cavazos ([email protected])•Office Hours: Tues/Thurs 11 AM to 12 PM, Smith Hall 412•Text: Engineering a Compiler by Keith Cooper and Linda Torzcan•Web Site: http://www.cis.udel.edu/~cavazos/CISC672Handouts, homework, slides, …I will not have handouts in class; get them from the webTopics in the design of programming language translators, including parsing, semantic analysis, error recovery, code generation, and optimizationBasis for Grading•ExamsMidterm 20% Final 20%•Quizzes 10%•ProjectsScanner 7%Parser 8%Semantic Analyzer 15%Code Generation 15%This only adds up to 95%. Where is the other 5%?Class participation!Notice: Any student with a disability requiring accommodations in this class is encouraged to contact me after class or during office hours, and to contact UDel’s Coordinator for Disabled Student Services.Basis for Grading•ExamsMidterm Final•Quizzes •ProjectsParser (& scanner)Semantic AnalyzerCode Generation Closed-notes, closed-book Old exam on web site as an example Reinforce concepts Number of quizzes t.b.d. Parser lab might be a team lab High ratio of thought to programming Will build a compiler for a language called COOL (in C++ or Java)Rough Syllabus•Overview § 1•Scanning § 2•Parsing § 3•Context Sensitive Analysis § 4•Inner Workings of Compiled Code § 6, 7•Introduction to Optimization § 8•Instruction Selection § 11•Instruction Scheduling § 12•Register Allocation § 13•More Optimization (time permitting)Class-taking technique for CISC 672•I will use projected material extensivelyI will moderate my speed, you sometimes need to say “STOP”•You should read the bookNot all material will be covered in classBook complements the lectures•You are responsible for material from classThe tests will cover both lecture and readingI will probably hint at good test questions in class•CISC 672 is not a programming courseProjects are graded on functionality, documentation, and lab reports more than style (results matter)•It will take me time to learn your names (please remind me)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 languageThe 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 languageThe 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 programCompilers•What is a compiler?A program that translates an executable program in one language into an executable program in another languageThe 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 can then interpretedOr a hybrid strategy is usedJust-in-time compilationTaking a Broader View• Compiler TechnologyOfflineTypically C, C++, FortranOnline Typically Java, C##Goals: improved performance and language usabilityMaking it practical to use the full power of the languageTrade-off: preprocessing time versus execution time (or space)Rule: performance of both compiler and application must be acceptable to the end userWhy Study Compilation?•Compilers are important system software componentsThey are intimately interconnected with architecture, systems, programming methodology, and language design•Compilers include many applications of theory to practiceScanning, parsing, static analysis, instruction selection•Many practical applications have embedded languagesCommands, macros, formatting tags …•Many applications have input formats that look like languages, Matlab, Mathematica•Writing a compiler exposes practical algorithmic & engineering issuesApproximating hard problems; efficiency & scalabilityIntrinsic interestCompiler construction involves ideas from many different parts of computer scienceArtificial intelligenceGreedy algorithmsHeuristic search techniquesAlgorithmsGraph algorithms, Dynamic programmingTheoryDFAs & PDAs, pattern matchingFixed-point algorithmsSystemsAllocation & naming, Synchronization, localityArchitecturePipeline & hierarchy management Instruction set useIntrinsic meritCompiler construction poses challenging and interesting problems:Compilers must do a lot but also run fastCompilers have responsibility for run-time performanceCompilers are responsible for making it acceptable to use the full power of the programming languageComputer architects perpetually create new challenges for the compiler by building more complex machinesCompilers must hide that complexity from the programmerSuccess requires mastery of complex interactionsAren’t compilers a solved problem?“Optimization for scalar machines is a problem that was solved ten years ago.”David Kuck, Fall 1990Aren’t compilers a solved problem?“Optimization for scalar machines is a problem that was solved ten years ago.”David Kuck, Fall 1990–Architectures keep changing–Languages keep changing–Applications keep changing - SPEC CPU? –When to compile keeps changingAbout the instructor•My own researchApplying machine learning to solve hard systems problemsCompiling for advanced microprocessor systemsInterplay between static and dynamic compilationOptimization for embedded systems (space, power, speed)Interprocedural analysis and optimizationNitty-gritty things that happen in compiler back endsDistributing compiled code in a heterogeneous environmentRethinking the fundamental structure of optimizing compilers•Thus, my interests lie inBuilding
View Full Document