This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Avoid extra index lookup during promotion
ClosedPublic

Authored by tejohnson on Nov 15 2019, 1:11 PM.

Details

Summary

Pass down the already accessed ValueInfo to shouldPromoteLocalToGlobal,
to avoid an unnecessary extra index lookup.

Add some assertion checking to confirm we have a non-empty VI when
expected.

Also some misc cleanup, merging the two versions of
doImportAsDefinition, since one was only called by the other, and
unnecessarily passed in a member variable.

Diff Detail

Event Timeline

tejohnson created this revision.Nov 15 2019, 1:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 1:11 PM
evgeny777 accepted this revision.Nov 18 2019, 12:09 AM

LGTM. BTW, do you have any data on performance improvement?

This revision is now accepted and ready to land.Nov 18 2019, 12:09 AM

LGTM. BTW, do you have any data on performance improvement?

No. It was just something I noticed when working on a patch that needed to get the VI for another reason in this code.

This revision was automatically updated to reflect the committed changes.