Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data-Flow Analysis (Chapter 11-12) Mooly Sagiv Make-up class 18/5 0900-12:00 Kaplun 324.

Similar presentations


Presentation on theme: "Data-Flow Analysis (Chapter 11-12) Mooly Sagiv Make-up class 18/5 0900-12:00 Kaplun 324."— Presentation transcript:

1 Data-Flow Analysis (Chapter 11-12) Mooly Sagiv Make-up class 18/5 0900-12:00 Kaplun 324

2 Data-Flow Analysis(Kildall 1973) Input: –A control flow graph Nodes – Basic blocks Edges- Jumps, Branches –Lattice L= –An element Init  L (The value at procedure entry) –The effect of every block F B : L  L Output: An upper approximation to the join over all paths JOP[B] =  P  Path(B) F Bn ...  F B2  F B1 (Init) Method –Find the least solution to: In[Entry] = Init In[B] =  B’  Pred(B) Out[B’] Out[B] = F B (In[B])

3 Tentative Plan Order of Optimizations Early Program Optimizations (Friday) Redundancy Elimination and Loop Optimizations (May 24) Procedures (May 31)

4 Order of Optimizations and Repetitions Transformations are order-dependent No “Optimal order” May need to repeat certain transformations

5 Textbook Order Scalar replacement of array references Data-cache optimizations A HIR Global value numbering … C MIR|LIR Procedure integration … B HIR|MIR In-line expansion … D LIR Interprocedural register allocation … E link-time constant-folding simplifications

6 Procedure integration Tail-call elimination Scalar replacement of aggregates Sparse conditional constant propagation Interprocedural constant propagation Procedure specialization and cloning Sparse conditional constant propagation Early High Level Optimizations (B) HIR|MIR constant-folding simplifications

7 MIR|LIR(C) constant-folding simplifications Global value numbering Local and global copy propagation Sparse conditional constant propagation Dead code elimination Common Subexpression Elimination Loop invariant code motion Partial redundency Elimination Dead code elimination code hoisting induction variable strength reduction linear function test replacement induction variable removal bound checking elimination, control flow optimizations

8 LIR(D) constant-folding simplifications Inline expansion Leaf-routine optimizations Shrink wrapping Machine idioms Tail merging Branch optimization and conditional moves Dead code elimination Software pipelining, … Instruction Scheduling 1 Register allocation Instruction Scheduling 2 Intraprocedural I-cache optimizations Instruction prefetching Data prefertching Branch predication

9 Link-time optimizations(E) Interprocedural register allocation Aggregation global references Interprcudural I-cache optimizations

10 Scalar replacement of array references Data-cache optimizations Procedure integration Tail-call elimination Scalar replacement of aggregates Sparse constant propagation Interprocedural constant propagation Procedure specialization and cloning Sparse conditional constant propagation Global value numbering Local and global copy propagation Sparse conditional constant propagation Dead code elimination Common Subexpression Elimination Loop invariant code motion Partial redundency Elimination Inline expansion Leaf-routine optimizations Instruction Scheduling 1 Register allocation Instruction Scheduling 2 Intraprocedural I-cache optimizations Instruction prefetching Data prefertching Branch predication Interprocedural register allocation Interprocedural I-cache optimization


Download ppt "Data-Flow Analysis (Chapter 11-12) Mooly Sagiv Make-up class 18/5 0900-12:00 Kaplun 324."

Similar presentations


Ads by Google