Creating multiple JITs on X86 in multiple threads causes multiple writes (of
authorNick Lewycky <nicholas@mxc.ca>
Sat, 3 Dec 2011 02:45:50 +0000 (02:45 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 3 Dec 2011 02:45:50 +0000 (02:45 +0000)
the same value) to this variable. This code could be refactored, but it doesn't
matter since the old JIT is going away. Add tsan annotations to ignore the
race.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145745 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86JITInfo.cpp

index 3f88fa69d0ee1a88f51dc46f497ad5ad5fd6561e..2145a331de73a46770eece82c2e0468d1be95b4e 100644 (file)
@@ -424,7 +424,9 @@ X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
 
 TargetJITInfo::LazyResolverFn
 X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
+  TsanIgnoreWritesBegin();
   JITCompilerFunction = F;
+  TsanIgnoreWritesEnd();
 
 #if defined (X86_32_JIT) && !defined (_MSC_VER)
   if (Subtarget->hasSSE1())