This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Fix ThinLTO crash
ClosedPublic

Authored by tejohnson on Aug 18 2017, 10:44 PM.

Details

Summary

Follow up to fix in r311023, which fixed the case where the combined
index is written to disk. The same samplePGO logic exists for the
in-memory index when computing imports, so we need to filter out
GlobalVariable summaries there too.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson created this revision.Aug 18 2017, 10:44 PM
davidxl added inline comments.Aug 18 2017, 10:53 PM
test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
2 ↗(On Diff #111802)

Are these necessary?

test/Transforms/FunctionImport/funcimport_var.ll
8 ↗(On Diff #111802)

line wrap intended?

10 ↗(On Diff #111802)

what is the difference beween llvm-lto2 and llvm-lto? what are these options for?

tejohnson added inline comments.Aug 19 2017, 8:34 AM
test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
2 ↗(On Diff #111802)

Yes, this is required when going through llvm-lto2.

test/Transforms/FunctionImport/funcimport_var.ll
8 ↗(On Diff #111802)

A lot of llvm-lto2 test lines are structured this way so that it is easier to see the symbol resolutions.

10 ↗(On Diff #111802)

llvm-lto uses the legacy LTO interface, which is still used by ld64 and some other custom linkers. llvm-lto2 tests the new linker resolution based LTO interface, which is used by gold and lld. Therefore it is required that resolutions for each symbol are provided. In general I think it is good to test with llvm-lto2 as well. Note that the version of the bug I am fixing can also be tested via llvm-lto via the "run" action which passes the index in-memory, so I have added that as well. Additionally, I am piping an output ELF for each through llvm-nm with a simple CHECK, since someone once told me this was good form to make sure that the expected output was created.

tejohnson updated this revision to Diff 111827.Aug 19 2017, 8:35 AM

Address comments

davidxl accepted this revision.Aug 19 2017, 8:52 AM

lgtm

This revision is now accepted and ready to land.Aug 19 2017, 8:52 AM
This revision was automatically updated to reflect the committed changes.