Section I
Supporting Feedback-directed
   Optimizations
Feedback Compilation
Use instrumented executable to collect profile information
   and feedback into the compiler (FDO)
St...
Instrumentation
Instrumentation code inserted during compilation at WHIRL
  level
 
     Data gathering can be performed ...
Instrumentation and Compilation Phases
Can instrument (and gather data) at different points during
   compilation process ...
Use of Value Profiles
Compute histogram of top few runtime values
1. Floating-point multiples
                            ...
Upcoming SlideShare
Loading in …5
×

I Fdo

610 views

Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

I Fdo

  1. 1. Section I Supporting Feedback-directed Optimizations
  2. 2. Feedback Compilation Use instrumented executable to collect profile information and feedback into the compiler (FDO) Steps: 1. To compile with instrumentation: -fb_create fb_file 1. Execute “training run”  Very slow execution run 1. Re-compile with -fb_opt fb_file Compilation flags must be the same in both compiles
  3. 3. Instrumentation Instrumentation code inserted during compilation at WHIRL level  Data gathering can be performed at same point during feedback compile  Precise correlation of feedback data with program code  Accuracy not affected by compilation flags (as long as they are same between the two compiles) Instrumented code are calls to runtime library libinstr.{so,a} Support different types of feedback data  BB frequencies  Edge frequencies  Value profiles
  4. 4. Instrumentation and Compilation Phases Can instrument (and gather data) at different points during compilation process (flag -fb_phase): 0. before VHO 1. before LNO 2. before WOPT 3. before CG Only later phases can use gathered profile data When code is transformed, need to update profile data  Utility functions provided for this purpose  Some guesses involved Default is –fb_phase 0  PathScale has not tested with other values for –fb_phase
  5. 5. Use of Value Profiles Compute histogram of top few runtime values 1. Floating-point multiples if (y == 1.0) x * y x y mostly 1.0 else x * y 2. Integer divides if (j == 2k) i << k i / j else i / y j mostly 2k 3. Indirect calls if (p == &foo) (*p)() foo() p mostly foo() Else (*p)()

×