llvm-project/llvm/test/Instrumentation
Vedant Kumar ee6c233ae0 [InstrProf] Use atomic profile counter updates for TSan
Thread sanitizer instrumentation fails to skip all loads and stores to
profile counters. This can happen if profile counter updates are merged:

  %.sink = phi i64* ...
  %pgocount5 = load i64, i64* %.sink
  %27 = add i64 %pgocount5, 1
  %28 = bitcast i64* %.sink to i8*
  call void @__tsan_write8(i8* %28)
  store i64 %27, i64* %.sink

To suppress TSan diagnostics about racy counter updates, make the
counter updates atomic when TSan is enabled. If there's general interest
in this mode it can be surfaced as a clang/swift driver option.

Testing: check-{llvm,clang,profile}

rdar://40477803

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

llvm-svn: 339955
2018-08-16 22:24:47 +00:00
..
AddressSanitizer [ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64. 2018-08-01 22:51:13 +00:00
BoundsChecking Fix crash in bounds checking. 2018-08-03 17:12:23 +00:00
DataFlowSanitizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
EfficiencySanitizer Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
HWAddressSanitizer [hwasan] Add -hwasan-with-ifunc flag. 2018-08-10 16:21:37 +00:00
InstrProfiling [InstrProf] Use atomic profile counter updates for TSan 2018-08-16 22:24:47 +00:00
MemorySanitizer [MSan] Shrink the register save area for non-SSE builds 2018-08-10 08:06:43 +00:00
SanitizerCoverage [sanitizer-coverage] don't instrument a function if it's entry block ends with 'unreachable' 2018-05-11 01:09:39 +00:00
ThreadSanitizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
cgprofile.ll [BFI] Use rounding while computing profile counts. 2018-08-16 00:26:59 +00:00