This is an archive of the discontinued LLVM Phabricator instance.

Fix ThinLTO crash with debug info
ClosedPublic

Authored by mehdi_amini on Aug 24 2016, 9:01 AM.

Details

Summary

Because the recent change about ODR type uniquing in the context,
we can reach types defined in another module during IR linking.
This triggered some assertions in case we IR link without starting
from an empty module. To alleviate that, we can self-map metadata
defined in the destination module so that they won't be visited.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to Fix ThinLTO crash with debug info.
mehdi_amini updated this object.
mehdi_amini added a reviewer: tejohnson.
mehdi_amini added a subscriber: llvm-commits.

Teresa: work-in-progress, I need to rebase on ToT and cleanup the test.

tejohnson edited edge metadata.Aug 31 2016, 12:45 PM

Ping, is this one ready for review? It fixes several ThinLTO debug issues

mehdi_amini updated this revision to Diff 70105.Sep 1 2016, 5:05 PM
mehdi_amini edited edge metadata.

Reduce the test case, ready to go!

mehdi_amini updated this revision to Diff 70108.Sep 1 2016, 5:12 PM

Make the test more robust, and add a FileCheck line

tejohnson accepted this revision.Sep 1 2016, 7:44 PM
tejohnson edited edge metadata.

LGTM with a couple of test case fixes noted below.

test/ThinLTO/X86/crash_debuginfo.ll
7 ↗(On Diff #70108)

How are you verifying that bar is imported? Can you check for the inlined add in the body of foo?

9 ↗(On Diff #70108)

s/NOt/NOT

This revision is now accepted and ready to land.Sep 1 2016, 7:44 PM
twoh added a subscriber: twoh.Sep 1 2016, 8:09 PM
mehdi_amini added inline comments.Sep 2 2016, 10:20 PM
test/ThinLTO/X86/crash_debuginfo.ll
7 ↗(On Diff #70108)

The "CHECK-NOT" fires when bar isn't imported (we get an undefined referenced to bar), this relies on the inliner.

This revision was automatically updated to reflect the committed changes.