Your SlideShare is downloading. ×
I Fdo
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

I Fdo

428
views

Published on

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
428
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Section I Supporting Feedback-directed Optimizations
  • 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. 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. 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. 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)()