This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Fix select instruction annotation
ClosedPublic

Authored by xur on Oct 25 2016, 12:57 PM.

Details

Summary

Select instruction annotation in IR PGO uses the edge count to infer the
branch count. It's currently placed in setInstrumentedCounts() where
no all the BB counts have been computed. This leads to wrong branch weights.
Move the annotation after all BB counts are populated.

Event Timeline

xur updated this revision to Diff 75773.Oct 25 2016, 12:57 PM
xur retitled this revision from to [PGO] Fix select instruction annotation.
xur updated this object.
xur added a reviewer: davidxl.
xur added a subscriber: llvm-commits.
davidxl added inline comments.Oct 25 2016, 1:21 PM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
685

that being read out --> that remains to be read.

686

initialize new members.

xur updated this revision to Diff 75795.Oct 25 2016, 2:38 PM

Integrated David's review comments.

davidxl accepted this revision.Oct 25 2016, 2:50 PM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Oct 25 2016, 2:50 PM
xur closed this revision.Oct 25 2016, 2:56 PM