DOC PREVIEW
UD CISC 672 - High-level View

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Wrapping UpHigh-level ViewSlide 3Front EndMiddle (Optimizer)Back EndSlide 7Slide 8Slide 9PerspectiveSlide 11Slide 12Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.The Last Lecture High-level ViewDefinitions•Compiler consumes code & produces code•Interpreter consumes executable & produces resultsSourcecodeMachinecodeCompilerErrorsThe Last Lecture High-level View•Front end consumes source code & produces IRDetermines code shape for rest of compiler •Middle reads & writes IRAnalyzes & transforms IR to “improve” itMyriad techniques at several distinct scopes•Back end consumes optimizes IR & produces target codeMaps code to target ISA & handles resource issuesErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRThe Last Lecture Front EndScanner•Applies DFA technology to classify words•Use RE-based tools to generate fast scannersParser•Takes stream of classified words & computes structure•Many techniques (TDRD, LL(1), LR(1) + others)Context-sensitive Analysis•Type-checking & IR generation (AGs & Ad-hoc SDT)•Problems are harder & tools not as well developedErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRSolved ProblemsThe Last Lecture Middle (Optimizer)•Typically structured as a series of passesAllows for separation of concernsSimplifies development & debugging•Rewrites IR to improve running time, code space, …•We studied redundancy eliminationOther optimizations include code motion, dead-code elimination, constant propagation, strength reduction, … (see Ch 10)Errors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRMost compilers need better optimization …The Last Lecture Back EndErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRThree Problems•Instruction SelectionMapping optimized IR to target machine’s ISA•Instruction SchedulingReordering operations to hide latencies & speed execution•Register AllocationMapping name space of optimized IR to target’s register setThe Last Lecture Back EndErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRInstruction Selection•This is a pattern-matching problemWe looked at tree pattern matching, peephole optimizationOther ideas: string matching, ad-hoc matching, parsing, …•Criterion is “local optimality”Map immediate context to ISA in an efficient wayLeave “global optimality” to optimizer•My algorithm of choice: peephole matchingThe Last Lecture Back EndErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRInstruction Scheduling•Fixed set of operations, can vary the orderMust preserve inter-operation dependencesMay change demand for registers•List scheduling is dominant paradigmApplied to blocks, extended blocks, regions in code•My algorithm of choice: Schielke’s RBF algorithm on EBBsThe Last Lecture Back EndErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRRegister Allocation•Handle disconnect between optimizer’s assumption of unlimited registers and chip’s limited setInsert loads and stores to reconcile the two models (spills)Minimize the slowdown•Global allocation via graph coloring is the dominant paradigmBuild interference graph and color itMany minor variations, but one strong themeThe Last Lecture PerspectiveDifferent concerns in each phase•Front end worries about shaping code for optimizationExpose facts that can be improved & tailored•Middle worries about global issues that affect speed, spaceRedundancy, constants, code motion, locality, ...•Back end worries about using the target’s resourcesAddress modes, functional units, registers, issue slots, …Errors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRThese concerns “bleed” from one phase to anotherThe Last Lecture PerspectiveDifferent complexities in each phase•Front end is mostly linear timeDFAs, parsers take time proportional to size of input stream•Middle is low-order polynomial timeAnalysis & optimization are O(n) to O(n2 ), in general•Back end solves hard problems with approximationsHeuristics that typically take O(n) to (n2) Underlying problems are seriously hardErrors SourceCodeMiddleFrontEndMachinecodeBackEndIRIRThe Last Lecture PerspectiveRemaining work•Front end is solvedNo more theses on parsing•Middle has some room for work (not a wide open frontier) New machines, new languages present new problems•Back end has room for workComplications from new machines Longer latencies, wider processorsErrors


View Full Document

UD CISC 672 - High-level View

Documents in this Course
Syllabus

Syllabus

18 pages

Load more
Download High-level View
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view High-level View and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view High-level View 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?