This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Change the ProfileSummary metadata merge behavior
AbandonedPublic

Authored by jakev on Jul 5 2016, 8:17 PM.

Details

Summary

The behavior when merging different ProfileSummary metadata really shouldn't be to throw an Error. This prevents users from doing LTO builds including IR files with older/different profile data applied.

Even if people think changing the behavior to Warning isn't the right approach, it would be good to move away from intentional failure.

Diff Detail

Repository
rL LLVM

Event Timeline

jakev updated this revision to Diff 62818.Jul 5 2016, 8:17 PM
jakev retitled this revision from to [PGO] Change the ProfileSummary metadata merge behavior.
jakev updated this object.
jakev added reviewers: eraman, davidxl, silvas.
jakev set the repository for this revision to rL LLVM.
jakev added a subscriber: llvm-commits.
eraman edited edge metadata.Jul 6 2016, 1:21 PM

All the modules are expected to have the same profile summary and changing the behavior to a warning is not the right thing to do. If we want to support a use case where we LTO files with different profile data, perhaps we should have a way to disable profile summary for those builds? That seems better than picking the first summary we see (as would be the case with a warning)

jakev added a comment.Jul 6 2016, 8:16 PM

All the modules are expected to have the same profile summary and changing the behavior to a warning is not the right thing to do. If we want to support a use case where we LTO files with different profile data, perhaps we should have a way to disable profile summary for those builds? That seems better than picking the first summary we see (as would be the case with a warning)

Yeah that seems reasonable. I'm not sure what the right way to do this is, but dropping the ProfileSummary metadata and giving up on any further merging when we encounter a conflict seems like the right idea. What do you think is the correct path forward here?

eraman added a comment.Jul 8 2016, 9:40 AM

I am trying to understand the use case here. Do you need to support a case where you compile different modules with different profiles and LTO them together? Isn't merging the profiles and using the merged profile an option there?

jakev added a comment.Jul 11 2016, 7:50 PM

I am trying to understand the use case here. Do you need to support a case where you compile different modules with different profiles and LTO them together? Isn't merging the profiles and using the merged profile an option there?

Apologies for the delay.

After some discussion about this with silvas offline, it seems that leaving the current behavior might be the easiest way to loudly inform users of the profile metadata mismatch. My initial concern was that, as a matter of principle, builds shouldn't fail due to stale profile information. LTO or otherwise. Since this is apparently a non-issue, I'll abandon the patch. Sorry for kicking up dust.

jakev abandoned this revision.Jul 18 2016, 8:09 PM