[llvm] c36eebb - [PS5] Use __gxx_personality_v0 for TSan
Paul Robinson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 10:39:43 PDT 2022
Author: Paul Robinson
Date: 2022-06-14T10:39:34-07:00
New Revision: c36eebb52e682fc0fcef6a25287a3a1d28198e40
URL: https://github.com/llvm/llvm-project/commit/c36eebb52e682fc0fcef6a25287a3a1d28198e40
DIFF: https://github.com/llvm/llvm-project/commit/c36eebb52e682fc0fcef6a25287a3a1d28198e40.diff
LOG: [PS5] Use __gxx_personality_v0 for TSan
Added:
llvm/test/Instrumentation/ThreadSanitizer/personality.ll
Modified:
llvm/lib/Analysis/EHPersonalities.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/EHPersonalities.cpp b/llvm/lib/Analysis/EHPersonalities.cpp
index df8b7e12e8d75..277ff6ba735f1 100644
--- a/llvm/lib/Analysis/EHPersonalities.cpp
+++ b/llvm/lib/Analysis/EHPersonalities.cpp
@@ -8,6 +8,7 @@
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
@@ -67,7 +68,10 @@ StringRef llvm::getEHPersonalityName(EHPersonality Pers) {
}
EHPersonality llvm::getDefaultEHPersonality(const Triple &T) {
- return EHPersonality::GNU_C;
+ if (T.isPS5())
+ return EHPersonality::GNU_CXX;
+ else
+ return EHPersonality::GNU_C;
}
bool llvm::canSimplifyInvokeNoUnwind(const Function *F) {
diff --git a/llvm/test/Instrumentation/ThreadSanitizer/personality.ll b/llvm/test/Instrumentation/ThreadSanitizer/personality.ll
new file mode 100644
index 0000000000000..7a0bd31fd9e97
--- /dev/null
+++ b/llvm/test/Instrumentation/ThreadSanitizer/personality.ll
@@ -0,0 +1,12 @@
+; RUN: opt --mtriple=x86_64-unknown-linux-gnu < %s -passes=tsan -S | FileCheck %s --check-prefix=GCC
+; RUN: opt --mtriple=x86_64-scei-ps4 < %s -passes=tsan -S | FileCheck %s --check-prefix=GCC
+; RUN: opt --mtriple=x86_64-sie-ps5 < %s -passes=tsan -S | FileCheck %s --check-prefix=GXX
+
+declare void @foo()
+
+define i32 @func1() sanitize_thread {
+ call void @foo()
+ ret i32 0
+ ; GCC: __gcc_personality_v0
+ ; GXX: __gxx_personality_v0
+}
More information about the llvm-commits
mailing list