This is an archive of the discontinued LLVM Phabricator instance.

Add ASan metadata globals to @llvm.compiler.used under COFF
ClosedPublic

Authored by aeubanks on Jun 4 2020, 9:59 AM.

Details

Summary

This matches ELF.

This makes the number of ASan failures under the new pass manager on
Windows go from 18 to 1.

Under the old pass manager, the ASan module pass was one of the very
last things run, so these globals didn't get removed due to GlobalOpt.
But with the NPM the ASan module pass that adds these globals are run
much earlier in the pipeline and GlobalOpt ends up removing them.

Diff Detail

Event Timeline

aeubanks created this revision.Jun 4 2020, 9:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2020, 9:59 AM

As for tests, I think making these work under the NPM, which we hopefully switch to soon, counts as tests.

hans added a comment.Jun 4 2020, 12:00 PM

As for tests, I think making these work under the NPM, which we hopefully switch to soon, counts as tests.

Adding checks for @llvm.compiler.used in llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll would probably be good too.

+eugenis who wrote the corresponding code for ELF

As for tests, I think making these work under the NPM, which we hopefully switch to soon, counts as tests.

Adding checks for @llvm.compiler.used in llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll would probably be good too.

Ah I didn't see those tests, I forgot that the instrumentation itself has tests.

hans accepted this revision.Jun 5 2020, 5:58 AM
This revision is now accepted and ready to land.Jun 5 2020, 5:58 AM
This revision was automatically updated to reflect the committed changes.