This is an archive of the discontinued LLVM Phabricator instance.

[SampleFDO] Add an option to turn on/off warning about samples unused
ClosedPublic

Authored by wmi on Jun 22 2018, 5:07 PM.

Details

Summary

If a function has sample to use, but cannot use them because of no debug information, currently a warning will be issued to inform the missing opportunity.

This warning assumes the binary generating the profile and the binary using the profile are similar enough. In some cases even if it is not similar enough, we may still get some benefit by using sampleFDO. In those cases, we may not want to see a lot of such warnings pop up.

The patch adds an option for the warning.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi created this revision.Jun 22 2018, 5:07 PM

Does this happen when the code the profile is being applied to is not being built with some necessary debug options like -gmlt? Can/should it be fixed by adding that or another option?

wmi added a comment.Jun 22 2018, 7:18 PM

Does this happen when the code the profile is being applied to is not being built with some necessary debug options like -gmlt? Can/should it be fixed by adding that or another option?

Yes, it is because -g0 is used in the code where the profile is applied. I am not sure whether the -g0 is required or not in that specific case. But I can imagine there is case where some module need to be built using -g0, and if we got sample for such module from elsewhere, the option will be needed there.

This revision is now accepted and ready to land.Jun 23 2018, 9:36 AM
This revision was automatically updated to reflect the committed changes.