Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lexical analyzer Parser Semantic analyzer Intermediate-code generator Optimizer Code Generator Postpass optimizer String of characters String of tokens.

Similar presentations


Presentation on theme: "Lexical analyzer Parser Semantic analyzer Intermediate-code generator Optimizer Code Generator Postpass optimizer String of characters String of tokens."— Presentation transcript:

1 Lexical analyzer Parser Semantic analyzer Intermediate-code generator Optimizer Code Generator Postpass optimizer String of characters String of tokens Parse tree Medium-level intermediate code Low-level intermediate code Relocatable object module or runable machine code The structure of an optimizing compiler

2 Source and high-level optimizations A B 4C4C D 1C1C5C5C2C2C3C3C E Scalar replacement of array references Data-cache optimization A

3 High and mid-level optimization A B 4C4C D 1C1C5C5C2C2C3C3C E Procedure integration Tail-call optimization, including tail-recursion elimination Scalar replacement of aggregates Sparse conditional constant propagation Interprocedural constant propagation Procedure specialization and cloning Sparse conditional constant propagation B

4 Medium and low-level optimizations A B 4C4C D 1C1C5C5C 2C2C3C3C E Global value numbering Local and global copy propagation Sparse conditional constant propagation Dead-code elimination C1 Local and global common sub-expression elimination Loop-invariant code motion C2 Partial-redundancy eliminationC3 Dead-code elimination Code hoisting Induction-variable strength reduction Linear-function test replacement Induction-variable removal Unnecessary bounds-checking elimination Control-flow optimizations C4 Constant folding Algebraic simplifications, including reaasociation C5

5 Low-level (machine dependent) optimizations A B 4C4C D 1C1C5C5C2C2C3C3C E In-line expansion Leaf-routine optimization Shrink wrapping Machine idioms Tail merging Branch optimizations and conditional moves Dead-code elimination Software pipelining, with loop unrolling, variable expansion, register renaming, and hierarchical reduction Basic-block and branch scheduling 1 Register allocation by graph coloring Basic-block and branch scheduling 2 Intraprocedural I-cache optimization Instruction prefetching Data prefetching Branch prediction D

6 Link-time optimizations A B 4C4C D 1C1C5C5C2C2C3C3C E Interprocedural register allocation Aggregation of global references Interprocedural I-cache optimization E


Download ppt "Lexical analyzer Parser Semantic analyzer Intermediate-code generator Optimizer Code Generator Postpass optimizer String of characters String of tokens."

Similar presentations


Ads by Google