[compiler-rt] 606557d - [PGO] use atomics for profile counters in instrprof-dlopen-norpath.test
Wael Yehia via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 07:58:21 PDT 2024
Author: Wael Yehia
Date: 2024-09-23T15:09:08Z
New Revision: 606557ddd68bcb082fb82fd21b0afb260222ae14
URL: https://github.com/llvm/llvm-project/commit/606557ddd68bcb082fb82fd21b0afb260222ae14
DIFF: https://github.com/llvm/llvm-project/commit/606557ddd68bcb082fb82fd21b0afb260222ae14.diff
LOG: [PGO] use atomics for profile counters in instrprof-dlopen-norpath.test
When two threads dlopen a shared library, one instance of the library
is loaded. Hence, code inside the library needs to be thread safe,
so use atomic updates for profile counters.
Added:
Modified:
compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test
Removed:
################################################################################
diff --git a/compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test b/compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test
index ba42433f98c296..0d750185204aed 100644
--- a/compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test
+++ b/compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test
@@ -1,8 +1,8 @@
RUN: rm -rf %t && split-file %s %t && cd %t
-RUN: %clang_pgogen -fPIC foo.c -c -Xclang -fprofile-instrument-path="default_foo_%m.profraw"
-RUN: %clang_pgogen -fPIC foo2.c -c -Xclang -fprofile-instrument-path="default_foo2_%m.profraw"
-RUN: %clang_pgogen -shared foo.o -o shr_foo.o %if target={{.*aix.*}} %{ -bcdtors:mbr %}
-RUN: %clang_pgogen -shared foo2.o -o shr_foo2.o
+RUN: %clang_pgogen -fprofile-update=atomic -fPIC foo.c -c -Xclang -fprofile-instrument-path="default_foo_%m.profraw"
+RUN: %clang_pgogen -fprofile-update=atomic -fPIC foo2.c -c -Xclang -fprofile-instrument-path="default_foo2_%m.profraw"
+RUN: %clang_pgogen -fprofile-update=atomic -shared foo.o -o shr_foo.o %if target={{.*aix.*}} %{ -bcdtors:mbr %}
+RUN: %clang_pgogen -fprofile-update=atomic -shared foo2.o -o shr_foo2.o
RUN: %clang_pgogen common.c -c
More information about the llvm-commits
mailing list