This is an archive of the discontinued LLVM Phabricator instance.

Don't drop the llvm. prefix when renaming
ClosedPublic

Authored by rafael on Oct 3 2016, 5:52 AM.

Details

Reviewers
pcc
apilipenko
Summary

If the llvm. prefix is dropped other parts of llvm don't see this as an intrinsic. This means that the number of regular symbols depends on the context the module is loaded into, which causes LTO to abort.

Diff Detail

Event Timeline

rafael updated this revision to Diff 73265.Oct 3 2016, 5:52 AM
rafael retitled this revision from to Don't drop the llvm. prefix when renaming.
rafael updated this object.
rafael added reviewers: apilipenko, pcc.
rafael set the repository for this revision to rL LLVM.
rafael added a subscriber: llvm-commits.
apilipenko edited edge metadata.Oct 3 2016, 6:58 AM

The change seems fine, but I'm curious how we end up with an old renamed intrinsic declaration? For some reason I can't reproduce the problem locally.

If we materialize the whole module we must remove old declarations from the module (see BitcodeReader::materializeModule). Althought if we use BitcodeReader::materialize old declaration will be kept in the module.

apilipenko accepted this revision.Oct 3 2016, 8:42 AM
apilipenko edited edge metadata.

I reproduced the problem with the testcase from the review. From what I see we lazily materialize the module, so old versions of upgraded intrinsics are not removed.

This revision is now accepted and ready to land.Oct 3 2016, 8:42 AM