This is an archive of the discontinued LLVM Phabricator instance.

Don't emit coverage mapping for excluded functions
ClosedPublic

Authored by phosek on Feb 3 2021, 11:01 PM.

Details

Summary

When a function or a file is excluded using -fprofile-list= option,
don't emit coverage mapping as doing so confuses users since those
functions would always have zero count. This also reduces the binary
size considerably in cases where only a few functions or files are
being instrumented.

Diff Detail

Event Timeline

phosek created this revision.Feb 3 2021, 11:01 PM
phosek requested review of this revision.Feb 3 2021, 11:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2021, 11:01 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vsk added inline comments.Feb 4 2021, 11:01 AM
clang/test/CodeGen/profile-filter.c
27

This is somewhat difficult to interpret. Would you be open to specifying -dump-coverage-mapping (e.g. https://godbolt.org/z/5PvvEv), in a separate cc1 invocation if needed, and checking that instead?

phosek updated this revision to Diff 321670.Feb 5 2021, 12:17 AM
phosek marked an inline comment as done.
phosek added inline comments.
clang/test/CodeGen/profile-filter.c
27

Thanks for the suggestion, this is definitely cleaner.

vsk accepted this revision.Feb 5 2021, 9:35 AM

Thanks, lgtm.

This revision is now accepted and ready to land.Feb 5 2021, 9:35 AM
This revision was landed with ongoing or failed builds.Feb 5 2021, 1:04 PM
This revision was automatically updated to reflect the committed changes.
phosek marked an inline comment as done.