This is an archive of the discontinued LLVM Phabricator instance.

Refine instruction weight annotation algorithm for sample profiler.
ClosedPublic

Authored by danielcdh on Apr 19 2016, 2:17 PM.

Details

Summary

This patch refined the instruction weight anootation algorithm:

  1. Do not use dbg_value intrinsics for annotation.
  2. Annotate cold calls if the call is inlined in profile, but not inlined before preparation. This indicates that the annotation preparation step found no sample for the inlined callsite, thus the call should be very cold.

Diff Detail

Event Timeline

danielcdh updated this revision to Diff 54261.Apr 19 2016, 2:17 PM
danielcdh retitled this revision from to Refine instruction weight annotation algorithm for sample profiler..
danielcdh updated this object.
danielcdh added reviewers: dnovillo, davidxl.
danielcdh added a subscriber: llvm-commits.
mgrang added a subscriber: mgrang.Apr 19 2016, 4:48 PM
mgrang added inline comments.
lib/Transforms/IPO/SampleProfile.cpp
460

Extraneous braces.

491

Extraneous braces.

danielcdh updated this revision to Diff 54389.Apr 20 2016, 10:17 AM

formatting

davidxl added inline comments.Apr 20 2016, 3:17 PM
lib/Transforms/IPO/SampleProfile.cpp
489

move R=0 to newline.

489

Since this is the else branch which means R already is zero, why do we need to reset it?

danielcdh added inline comments.Apr 20 2016, 4:04 PM
lib/Transforms/IPO/SampleProfile.cpp
489

R is ErrorOr<uint64_t>, so else branch means that R is undefined instead of 0.

davidxl accepted this revision.Apr 20 2016, 4:28 PM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Apr 20 2016, 4:28 PM
danielcdh closed this revision.Apr 20 2016, 4:41 PM