[llvm] c3ec3ed - [LLVM][OHOS] Use emulated TLS for OHOS platform

Pavel Kosov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 07:36:25 PDT 2023


Author: Pavel Kosov
Date: 2023-04-17T17:35:22+03:00
New Revision: c3ec3ed2a1f3faf30ad2adde426a2f3b5002f3ac

URL: https://github.com/llvm/llvm-project/commit/c3ec3ed2a1f3faf30ad2adde426a2f3b5002f3ac
DIFF: https://github.com/llvm/llvm-project/commit/c3ec3ed2a1f3faf30ad2adde426a2f3b5002f3ac.diff

LOG: [LLVM][OHOS] Use emulated TLS for OHOS platform

Both Linux and LiteOS for all OpenHarmony targets use emulated TLS

~~~

Huawei RRI, OS Lab

Reviewed By: DavidSpickett, jrtc27, MaskRay

Differential Revision: https://reviews.llvm.org/D145224

Added: 
    

Modified: 
    llvm/include/llvm/TargetParser/Triple.h
    llvm/test/CodeGen/X86/emutls-pic.ll

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index b96e487b735f5..143786104d313 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -980,7 +980,8 @@ class Triple {
 
   /// Tests whether the target uses emulated TLS as default.
   bool hasDefaultEmulatedTLS() const {
-    return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment();
+    return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment() ||
+           isOHOSFamily();
   }
 
   /// Tests whether the target uses -data-sections as default.

diff  --git a/llvm/test/CodeGen/X86/emutls-pic.ll b/llvm/test/CodeGen/X86/emutls-pic.ll
index d5daa3b6677e0..f09c1cfc95221 100644
--- a/llvm/test/CodeGen/X86/emutls-pic.ll
+++ b/llvm/test/CodeGen/X86/emutls-pic.ll
@@ -7,6 +7,8 @@
 ; RUN: llc < %s -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=NoEMU %s
 ; RUN: llc < %s -mtriple=i386-linux-android -relocation-model=pic | FileCheck -check-prefix=X86 %s
 ; RUN: llc < %s -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck -check-prefix=X64 %s
+; RUN: llc < %s -mtriple=i386-linux-ohos -relocation-model=pic | FileCheck -check-prefix=X86 %s
+; RUN: llc < %s -mtriple=x86_64-linux-ohos -relocation-model=pic | FileCheck -check-prefix=X64 %s
 
 ; NoEMU-NOT: __emutls
 


        


More information about the llvm-commits mailing list