This is an archive of the discontinued LLVM Phabricator instance.

[PGO] early exit if all count values are zero
ClosedPublic

Authored by xur on Nov 7 2018, 8:52 AM.

Details

Summary

If all the edge counts for a function are zero, skip count population and annotation, as nothing will happen. This can save some compile time.

Diff Detail

Repository
rL LLVM

Event Timeline

xur created this revision.Nov 7 2018, 8:52 AM
davidxl added inline comments.Nov 7 2018, 9:13 AM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
1485 ↗(On Diff #172965)

Is function entry annotated ?

xur updated this revision to Diff 172978.Nov 7 2018, 10:08 AM

set entry count

Can you add a simple test case making sure the func entry is properly annotated?

xur updated this revision to Diff 173006.Nov 7 2018, 12:34 PM

Add a testcase.

davidxl accepted this revision.Nov 7 2018, 1:02 PM

lgtm

This revision is now accepted and ready to land.Nov 7 2018, 1:02 PM
This revision was automatically updated to reflect the committed changes.