This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Loosen up variable importing correctness checks
ClosedPublic

Authored by tejohnson on May 1 2023, 8:16 PM.

Details

Summary

After importing variables, we do some checking to ensure that variables
marked read or write only, which have been marked exported (e.g.
because a referencing function has been exported), are on at least one
module's imports list. This is because the read or write only variables
will be internalized, so we need a copy any any module that references
it.

This checking is overly conservative in the case of linkonce_odr or
other linkage types where there can already be a duplicate copy in
existence in the importing module, which therefore wouldn't need to
import it. Loosen up the checking for these linkage types.

Fixes https://github.com/llvm/llvm-project/issues/62468.

Diff Detail

Event Timeline

tejohnson created this revision.May 1 2023, 8:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2023, 8:16 PM
tejohnson requested review of this revision.May 1 2023, 8:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2023, 8:16 PM
int3 accepted this revision.May 2 2023, 7:37 AM

Thank you! :D

This revision is now accepted and ready to land.May 2 2023, 7:37 AM
tejohnson edited the summary of this revision. (Show Details)May 2 2023, 7:46 AM