This is an archive of the discontinued LLVM Phabricator instance.

[SanitizerCoverage] Add fallback DebugLocation for instrumented calls
ClosedPublic

Authored by jkl on Jul 15 2023, 10:53 AM.

Details

Summary

When building the kernel with LTO, KCOV & debug information enabled,
multiple inlinable SanitizerCoverage functions require debug information
present.

In such cases we repurpose the InstrumentationIRBuilder that ensures
the necessary debug information is added if necessary.

This has been done analogous to the work for the ThreadSanitizer
in D124937. (I added reviewers based on that, feel free to ignore or add more if not relevant).

This has already been discussed a bit here: https://github.com/ClangBuiltLinux/linux/issues/1721

Diff Detail

Event Timeline

jkl created this revision.Jul 15 2023, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2023, 10:53 AM
jkl requested review of this revision.Jul 15 2023, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2023, 10:53 AM
melver accepted this revision.Jul 17 2023, 12:41 AM
melver added inline comments.
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
6

Is sanitize_address needed for this test?

This revision is now accepted and ready to land.Jul 17 2023, 12:41 AM
jkl added inline comments.Jul 17 2023, 1:49 AM
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
6

oh, no. It's just a leftover from copying the other test. LKM if I should send an update or if you just want to fix it when committing

melver added inline comments.Jul 17 2023, 2:07 AM
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
6

I assume it's trivial to fix, so just fixing it before committing is fine.

6

Oh, do you have commit access, or should I commit it?

jkl added inline comments.Jul 17 2023, 2:48 AM
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
6

No I don't, so you can just go ahead with it. Thanks!

This revision was landed with ongoing or failed builds.Jul 17 2023, 8:52 AM
This revision was automatically updated to reflect the committed changes.