This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Handle conflicting local names gracefully
ClosedPublic

Authored by tejohnson on Jan 6 2017, 1:14 PM.

Details

Summary

r285871 introduced an assert that was overly aggressive in the case
of a same-named local in different same-named files (in different
directories), where the source name and therefore the GUID ended up
the same because the files were compiled in their own directory without
any leading path. Change the handling in the promotion logic to get
the summary for the version in that module.

This also exposed an issue where we are not always importing the
right copy, which is a performance not correctness issue (because
the renaming is based on the module hash which must be different,
see the bug report for details). I will fix that as a follow-on.

Fixes PR31561.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 83413.Jan 6 2017, 1:14 PM
tejohnson retitled this revision from to [ThinLTO] Handle conflicting local names gracefully.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added a subscriber: llvm-commits.
mehdi_amini accepted this revision.Jan 6 2017, 1:23 PM
mehdi_amini edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jan 6 2017, 1:23 PM
mehdi_amini added inline comments.Jan 6 2017, 1:23 PM
test/ThinLTO/X86/local_name_conflict.ll
16 ↗(On Diff #83413)

I'd use a different name here, it does not seems related to what you're testing right?

tejohnson added inline comments.Jan 6 2017, 1:25 PM
test/ThinLTO/X86/local_name_conflict.ll
16 ↗(On Diff #83413)

The name has to be the same in the two Inputs versions, but not here. I will change this file's source name to something slightly different like local_name_conflict_main.c/o

This revision was automatically updated to reflect the committed changes.