CSU CS 553 - Profile-Guided Optimization (5 pages)

Previewing pages 1, 2 of 5 page document View the full content.
View Full Document

Profile-Guided Optimization



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Profile-Guided Optimization

119 views

Lecture Notes


Pages:
5
School:
Colorado State University- Fort Collins
Course:
Cs 553 - Programming Language Design and Implementation

Unformatted text preview:

Profile Guided Optimizations Motivation for Profiling Recall Instruction scheduling List scheduling Register renaming Loop unrolling Software pipelining Limitations of static analysis Compilers can analyze possible paths but must behave conservatively Frequency information cannot be obtained through static analysis How runtime information helps Control flow information if c Alias analysis how can we use alias analysis for instruction scheduling what causes conservative results 10 Today More instruction scheduling Profiling Trace scheduling CS553 Lecture Profile Guided Optimizations 90 Optimize the more frequent path perhaps at the expense of the less frequent path Memory conflicts st r1 0 r5 ld r2 0 r4 2 CS553 Lecture If r5 and r4 always have different values we can move the load above the store Profile Guided Optimizations Profile Guided Optimizations Profiling Issues Basic idea Instrument and run program on sample inputs to get likely runtime behavior Can use this information to improve instruction scheduling Many other uses Code placement Inlining Value speculation Branch prediction Class based optimization static method lookup Profile data Collected over whole program run May not be useful unbiased branches May not reflect all runs May be expensive and inconvenient to gather Continuous profiling Anderson 97 May interfere with program CS553 Lecture Profile Guided Optimizations 4 CS553 Lecture Profile Guided Optimizations 3 5 1 Control Flow Profiles Code Motion Using Control Flow Profiles Commonly gather two types of information Execution frequencies of basic blocks Branch frequencies of conditional branches Represent information in a weighted flow graph Code motion across basic blocks Increased scheduling freedom 1 100 execution frequencies 2 100 70 30 3 70 4 30 A B C If we want to move s1 to A we must move s1 to both A and B s1 move code above a join branch frequencies A s1 Instrumentation Insert instrumentation code at basic block entrances and before each



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Profile-Guided Optimization 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 Profile-Guided Optimization 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?