This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Compute GUID directly from GV when building per-module index
ClosedPublic

Authored by tejohnson on Jun 6 2018, 1:28 PM.

Details

Summary

I discovered when writing the summary parsing support that the
per-module index builder and writer are computing the GUID from the
value name alone (ignoring the linkage type). This was ok since those
GUID were not emitted in the bitcode, and there are never multiple
conflicting names in a single module.

However, I don't see a reason for making the GUID computation different
for the per-module case. It also makes things simpler on the parsing
side to have the GUID computation consistent. So this patch changes the
summary analysis phase and the per-module summary writer to compute the
GUID using the facility on the GlobalValue.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson created this revision.Jun 6 2018, 1:28 PM
tejohnson edited the summary of this revision. (Show Details)

What's the potential overhead of this choice (memory, runtime)?

What's the potential overhead of this choice (memory, runtime)?

Nothing that should be significant - it just modifies the way we compute the GUID slightly, to include the linkage type and the source file name from the parent Module, so those are accessed more frequently when building/writing the index, but it should be insignificant overall.

dexonsmith accepted this revision.Jun 25 2018, 3:50 PM

Okay, this LGTM then.

This revision is now accepted and ready to land.Jun 25 2018, 3:50 PM
This revision was automatically updated to reflect the committed changes.