Skip to content

Commit c51a12d

Browse files
committed
Revert "[tsan] Replace mem intrinsics with calls to interceptors"
Breaks http://45.33.8.238/macm1/43944/step_4.txt https://lab.llvm.org/buildbot/#/builders/70/builds/26926 This reverts commit 77654a6.
1 parent 0c7abd3 commit c51a12d

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

compiler-rt/lib/tsan/rtl/tsan.syms.extra

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ __tsan_java*
99
__tsan_unaligned*
1010
__tsan_release
1111
__tsan_acquire
12-
__tsan_memcpy
13-
__tsan_memmove
14-
__tsan_memset
1512
__tsan_mutex_create
1613
__tsan_mutex_destroy
1714
__tsan_mutex_pre_lock

compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,17 +3059,3 @@ extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __tsan_testonly_barrier_wait(
30593059
FutexWait(barrier, cur);
30603060
}
30613061
}
3062-
3063-
extern "C" {
3064-
__attribute__((alias(SANITIZER_STRINGIFY(WRAP(memcpy))),
3065-
visibility("default"))) void *
3066-
__tsan_memcpy(void *dst, const void *src, uptr size);
3067-
3068-
__attribute__((alias(SANITIZER_STRINGIFY(WRAP(memset))),
3069-
visibility("default"))) void *
3070-
__tsan_memset(void *dst, int c, uptr size);
3071-
3072-
__attribute__((alias(SANITIZER_STRINGIFY(WRAP(memmove))),
3073-
visibility("default"))) void *
3074-
__tsan_memmove(void *dst, const void *src, uptr size);
3075-
}

compiler-rt/lib/tsan/rtl/tsan_interface.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ SANITIZER_INTERFACE_ATTRIBUTE void __tsan_vptr_read(void **vptr_p);
7272
SANITIZER_INTERFACE_ATTRIBUTE
7373
void __tsan_vptr_update(void **vptr_p, void *new_val);
7474

75-
SANITIZER_INTERFACE_ATTRIBUTE
76-
void *__tsan_memcpy(void *dest, const void *src, uptr count);
77-
SANITIZER_INTERFACE_ATTRIBUTE
78-
void *__tsan_memset(void *dest, int ch, uptr count);
79-
SANITIZER_INTERFACE_ATTRIBUTE
80-
void *__tsan_memmove(void *dest, const void *src, uptr count);
81-
8275
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_entry(void *call_pc);
8376
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_exit();
8477

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ void ThreadSanitizer::initialize(Module &M) {
341341
}
342342

343343
MemmoveFn =
344-
M.getOrInsertFunction("__tsan_memmove", Attr, IRB.getInt8PtrTy(),
344+
M.getOrInsertFunction("memmove", Attr, IRB.getInt8PtrTy(),
345345
IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), IntptrTy);
346346
MemcpyFn =
347-
M.getOrInsertFunction("__tsan_memcpy", Attr, IRB.getInt8PtrTy(),
347+
M.getOrInsertFunction("memcpy", Attr, IRB.getInt8PtrTy(),
348348
IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), IntptrTy);
349349
MemsetFn =
350-
M.getOrInsertFunction("__tsan_memset", Attr, IRB.getInt8PtrTy(),
350+
M.getOrInsertFunction("memset", Attr, IRB.getInt8PtrTy(),
351351
IRB.getInt8PtrTy(), IRB.getInt32Ty(), IntptrTy);
352352
}
353353

llvm/test/Instrumentation/ThreadSanitizer/tsan_basic.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ entry:
3535
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %x, i8* align 4 %y, i64 16, i1 false)
3636
ret void
3737
; CHECK: define void @MemCpyTest
38-
; CHECK: call i8* @__tsan_memcpy
38+
; CHECK: call i8* @memcpy
3939
; CHECK: ret void
4040
}
4141

@@ -44,7 +44,7 @@ entry:
4444
tail call void @llvm.memcpy.inline.p0i8.p0i8.i64(i8* align 4 %x, i8* align 4 %y, i64 16, i1 false)
4545
ret void
4646
; CHECK: define void @MemCpyInlineTest
47-
; CHECK: call i8* @__tsan_memcpy
47+
; CHECK: call i8* @memcpy
4848
; CHECK: ret void
4949
}
5050

@@ -53,7 +53,7 @@ entry:
5353
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %x, i8* align 4 %y, i64 16, i1 false)
5454
ret void
5555
; CHECK: define void @MemMoveTest
56-
; CHECK: call i8* @__tsan_memmove
56+
; CHECK: call i8* @memmove
5757
; CHECK: ret void
5858
}
5959

@@ -62,7 +62,7 @@ entry:
6262
tail call void @llvm.memset.p0i8.i64(i8* align 4 %x, i8 77, i64 16, i1 false)
6363
ret void
6464
; CHECK: define void @MemSetTest
65-
; CHECK: call i8* @__tsan_memset
65+
; CHECK: call i8* @memset
6666
; CHECK: ret void
6767
}
6868

@@ -71,7 +71,7 @@ entry:
7171
tail call void @llvm.memset.inline.p0i8.i64(i8* align 4 %x, i8 77, i64 16, i1 false)
7272
ret void
7373
; CHECK: define void @MemSetInlineTest
74-
; CHECK: call i8* @__tsan_memset
74+
; CHECK: call i8* @memset
7575
; CHECK: ret void
7676
}
7777

0 commit comments

Comments
 (0)