[llvm-branch-commits] [llvm-branch] r276810 - Merging r276015:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 26 14:22:58 PDT 2016
Author: hans
Date: Tue Jul 26 16:22:57 2016
New Revision: 276810
URL: http://llvm.org/viewvc/llvm-project?rev=276810&view=rev
Log:
Merging r276015:
------------------------------------------------------------------------
r276015 | vedantk | 2016-07-19 13:16:08 -0700 (Tue, 19 Jul 2016) | 7 lines
[tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda*
r274801 did not go far enough to allow gcov+tsan to cooperate. With this
commit it's possible to run the following code without false positives:
std::thread T1(fib), T2(fib);
T1.join(); T2.join();
------------------------------------------------------------------------
Modified:
llvm/branches/release_39/ (props changed)
llvm/branches/release_39/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
llvm/branches/release_39/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll
Propchange: llvm/branches/release_39/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 16:22:57 2016
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,275870,275879,275898,275928,275935,275946,276077,276109,276181,276236-276237,276358,276364,276368,276389,276438,276479,276510
+/llvm/trunk:155241,275870,275879,275898,275928,275935,275946,276015,276077,276109,276181,276236-276237,276358,276364,276368,276389,276438,276479,276510
Modified: llvm/branches/release_39/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/lib/Transforms/Instrumentation/ThreadSanitizer.cpp?rev=276810&r1=276809&r2=276810&view=diff
==============================================================================
--- llvm/branches/release_39/lib/Transforms/Instrumentation/ThreadSanitizer.cpp (original)
+++ llvm/branches/release_39/lib/Transforms/Instrumentation/ThreadSanitizer.cpp Tue Jul 26 16:22:57 2016
@@ -272,8 +272,9 @@ static bool shouldInstrumentReadWriteFro
return false;
}
- // Check if the global is in a GCOV counter array.
- if (GV->getName().startswith("__llvm_gcov_ctr"))
+ // Check if the global is private gcov data.
+ if (GV->getName().startswith("__llvm_gcov") ||
+ GV->getName().startswith("__llvm_gcda"))
return false;
}
Modified: llvm/branches/release_39/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll?rev=276810&r1=276809&r2=276810&view=diff
==============================================================================
--- llvm/branches/release_39/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll (original)
+++ llvm/branches/release_39/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll Tue Jul 26 16:22:57 2016
@@ -13,6 +13,8 @@ target triple = "x86_64-apple-macosx10.9
@__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer
@__llvm_gcov_ctr.1 = internal global [1 x i64] zeroinitializer
+ at __llvm_gcov_global_state_pred = internal global i32 0
+ at __llvm_gcda_foo = internal global i32 0
define i32 @test_gep() sanitize_thread {
entry:
@@ -42,5 +44,16 @@ entry:
ret i32 undef
}
+define void @test_load() sanitize_thread {
+entry:
+ %0 = load i32, i32* @__llvm_gcov_global_state_pred
+ store i32 1, i32* @__llvm_gcov_global_state_pred
+
+ %1 = load i32, i32* @__llvm_gcda_foo
+ store i32 1, i32* @__llvm_gcda_foo
+
+ ret void
+}
+
; CHECK-NOT: {{call void @__tsan_write}}
; CHECK: __tsan_init
More information about the llvm-branch-commits
mailing list