aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-06-20 21:24:26 +0000
committerVedant Kumar <vsk@apple.com>2016-06-20 21:24:26 +0000
commit0222adbcd25779a156399bcc16fde9f6d083a809 (patch)
tree15d949ec30fe57d33efc5cc5297c6db699a14a11 /llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
parent9ad8fb68f77594829fa88a19981fbb55ab1abf2f (diff)
downloadllvm-0222adbcd25779a156399bcc16fde9f6d083a809.zip
llvm-0222adbcd25779a156399bcc16fde9f6d083a809.tar.gz
llvm-0222adbcd25779a156399bcc16fde9f6d083a809.tar.bz2
[tsan] Do not instrument accesses to the gcov counters array
There is a known intended race here. This is a follow-up to r264805, which disabled tsan instrumentation for updates to instrprof counters. For more background on this please see the discussion in D18164. llvm-svn: 273202
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
index eed77b7..22a26d4 100644
--- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
@@ -271,6 +271,10 @@ static bool shouldInstrumentReadWriteFromAddress(Value *Addr) {
/*AddSegment=*/false)))
return false;
}
+
+ // Check if the global is in the GCOV counters array.
+ if (GV->getName() == "__llvm_gcov_ctr")
+ return false;
}
return true;
}