llvm-project/llvm/test/Instrumentation
Alexander Potapenko 06d00afa61 MSan: handle llvm.lifetime.start intrinsic
Summary:
When a variable goes into scope several times within a single function
or when two variables from different scopes share a stack slot it may
be incorrect to poison such scoped locals at the beginning of the
function.
In the former case it may lead to false negatives (see
https://github.com/google/sanitizers/issues/590), in the latter - to
incorrect reports (because only one origin remains on the stack).

If Clang emits lifetime intrinsics for such scoped variables we insert
code poisoning them after each call to llvm.lifetime.start().
If for a certain intrinsic we fail to find a corresponding alloca, we
fall back to poisoning allocas for the whole function, as it's now
impossible to tell which alloca was missed.

The new instrumentation may slow down hot loops containing local
variables with lifetime intrinsics, so we allow disabling it with
-mllvm -msan-handle-lifetime-intrinsics=false.

Reviewers: eugenis, pcc

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 359536
2019-04-30 08:35:14 +00:00
..
AddressSanitizer Asan use-after-scope: don't poison allocas if there were untraced lifetime intrinsics in the function (PR41481) 2019-04-16 07:54:20 +00:00
BoundsChecking Fix a hang when lowering __builtin_dynamic_object_size 2019-04-10 23:42:11 +00:00
DataFlowSanitizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
HWAddressSanitizer hwasan: Enable -hwasan-allow-ifunc by default. 2019-04-09 00:25:59 +00:00
InstrOrderFile Add a module pass for order file instrumentation 2019-02-28 20:13:38 +00:00
InstrProfiling [InstrProf] Use separate comdat group for data and counters 2019-02-27 23:38:44 +00:00
MemorySanitizer MSan: handle llvm.lifetime.start intrinsic 2019-04-30 08:35:14 +00:00
SanitizerCoverage IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
ThreadSanitizer [NewPM][TSan] Reiterate the TSan port 2019-01-16 09:28:01 +00:00
cgprofile.ll [BFI] Use rounding while computing profile counts. 2018-08-16 00:26:59 +00:00