[all-commits] [llvm/llvm-project] 4a8b12: [AddressSanitizer] Add fallback DebugLocation for ...

Marco Elver via All-commits all-commits at lists.llvm.org
Mon Jul 17 08:52:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a8b1249306ff11f229320abdeadf0c215a00400
      https://github.com/llvm/llvm-project/commit/4a8b1249306ff11f229320abdeadf0c215a00400
  Author: Jakob Koschel <jakobkoschel at gmail.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    A llvm/test/Instrumentation/AddressSanitizer/missing_dbg.ll

  Log Message:
  -----------
  [AddressSanitizer] Add fallback DebugLocation for instrumented calls

When building the kernel with LTO, KASAN & debug information enabled,
multiple inlinable AddressSanitizer 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.

Bug: https://github.com/ClangBuiltLinux/linux/issues/1721

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D155376


  Commit: 913f7e93dac67ecff47bade862ba42f27cb68ca9
      https://github.com/llvm/llvm-project/commit/913f7e93dac67ecff47bade862ba42f27cb68ca9
  Author: Jakob Koschel <jakobkoschel at gmail.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
    A llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll

  Log Message:
  -----------
  [SanitizerCoverage] Add fallback DebugLocation for instrumented calls

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.

Bug: https://github.com/ClangBuiltLinux/linux/issues/1721

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D155377


  Commit: 4eef2e30d6f89328a16d4f1d6b37f1c79afe850c
      https://github.com/llvm/llvm-project/commit/4eef2e30d6f89328a16d4f1d6b37f1c79afe850c
  Author: Marco Elver <elver at google.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
    M llvm/test/Instrumentation/ThreadSanitizer/missing_dbg.ll

  Log Message:
  -----------
  [ThreadSanitizer] Add fallback DebugLocation for memintrinsic calls

When building with debug info enabled, some load/store instructions do
not have a DebugLocation attached. When using the default IRBuilder, it
attempts to copy the DebugLocation from the insertion-point instruction.
When there's no DebugLocation, no attempt is made to add one.

Add a fallback DebugLocation with the help of InstrumentationIRBuilder for
memintrinsics. In particular, the compiler may optimize load/store without
debug info into memintrinsics, which then are missing debug info as well.


Compare: https://github.com/llvm/llvm-project/compare/fda45d9198c8...4eef2e30d6f8


More information about the All-commits mailing list