This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Reduce unnecessary map lookups during combined summary write
ClosedPublic

Authored by tejohnson on May 28 2017, 12:19 PM.

Details

Summary

Don't assign values to undefined references, simply don't emit those
reference edges as they are not useful (we were already not emitting
call edges to undefined refs).

Also, streamline the later lookup of value ids when writing the
summaries, by combining the check for value id existence with the access
of that value id.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson created this revision.May 28 2017, 12:19 PM
pcc accepted this revision.May 30 2017, 5:09 PM

LGTM

lib/Bitcode/Writer/BitcodeWriter.cpp
381 ↗(On Diff #100561)

I think you can now remove this function as it is unused.

This revision is now accepted and ready to land.May 30 2017, 5:09 PM
pcc added a comment.May 30 2017, 5:10 PM

Oh and please add a test case if possible.

tejohnson marked an inline comment as done.May 31 2017, 11:57 AM
In D33634#768361, @pcc wrote:

Oh and please add a test case if possible.

Added a reference to an undefined global in an existing test, which will cause the checks on the combined summary to fail without this patch.

Address comments

This revision was automatically updated to reflect the committed changes.