mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-24 21:25:41 +00:00
dc73dc09f1
The 'common' section TLS is not implemented. Current C/C++ TLS variables are not placed in common section. DWARF debug info to get the address of TLS variables is not generated yet. clang and driver changes in http://reviews.llvm.org/D10524 Added -femulated-tls flag to select the emulated TLS model, which will be used for old targets like Android that do not support ELF TLS models. Added TargetLowering::LowerToTLSEmulatedModel as a target-independent function to convert a SDNode of TLS variable address to a function call to __emutls_get_address. Added into lib/Target/*/*ISelLowering.cpp to call LowerToTLSEmulatedModel for TLSModel::Emulated. Although all targets supporting ELF TLS models are enhanced, emulated TLS model has been tested only for Android ELF targets. Modified AsmPrinter.cpp to print the emutls_v.* and emutls_t.* variables for emulated TLS variables. Modified DwarfCompileUnit.cpp to skip some DIE for emulated TLS variabls. TODO: Add proper DIE for emulated TLS variables. Added new unit tests with emulated TLS. Differential Revision: http://reviews.llvm.org/D10522 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243438 91177308-0d34-0410-b5e6-96231b3b80d8
66 lines
1.9 KiB
LLVM
66 lines
1.9 KiB
LLVM
; RUN: llc < %s -emulated-tls -march=x86 -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck %s
|
|
; RUN: llc < %s -emulated-tls -march=x86-64 -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck %s
|
|
|
|
; Make sure that some symboles are not emitted in emulated TLS model.
|
|
|
|
@external_x = external thread_local global i32
|
|
@external_y = thread_local global i32 7
|
|
@internal_y = internal thread_local global i32 9
|
|
@internal_y0 = internal thread_local global i32 0
|
|
|
|
define i32* @get_external_x() {
|
|
entry:
|
|
ret i32* @external_x
|
|
}
|
|
|
|
define i32* @get_external_y() {
|
|
entry:
|
|
ret i32* @external_y
|
|
}
|
|
|
|
define i32* @get_internal_y() {
|
|
entry:
|
|
ret i32* @internal_y
|
|
}
|
|
|
|
define i32* @get_internal_y0() {
|
|
entry:
|
|
ret i32* @internal_y0
|
|
}
|
|
|
|
; no direct access to emulated TLS variables.
|
|
; no definition of emulated TLS variables.
|
|
; no initializer for external TLS variables, __emutls_t.external_x
|
|
; no initializer for 0-initialized TLS variables, __emutls_t.internal_y0
|
|
; not global linkage for __emutls_t.external_y
|
|
|
|
; CHECK-NOT: external_x@TLS
|
|
; CHECK-NOT: external_y@TLS
|
|
; CHECK-NOT: internal_y@TLS
|
|
; CHECK-NOT: .size external_x
|
|
; CHECK-NOT: .size external_y
|
|
; CHECK-NOT: .size internal_y
|
|
; CHECK-NOT: .size internal_y0
|
|
; CHECK-NOT: __emutls_v.external_x:
|
|
; CHECK-NOT: __emutls_t.external_x:
|
|
; CHECK-NOT: __emutls_t.internal_y0:
|
|
; CHECK-NOT: global __emutls_t.external_y
|
|
; CHECK-NOT: global __emutls_v.internal_y
|
|
; CHECK-NOT: global __emutls_v.internal_y0
|
|
|
|
; CHECK: __emutls_t.external_y
|
|
|
|
; CHECK-NOT: external_x@TLS
|
|
; CHECK-NOT: external_y@TLS
|
|
; CHECK-NOT: internal_y@TLS
|
|
; CHECK-NOT: .size external_x
|
|
; CHECK-NOT: .size external_y
|
|
; CHECK-NOT: .size internal_y
|
|
; CHECK-NOT: .size internal_y0
|
|
; CHECK-NOT: __emutls_v.external_x:
|
|
; CHECK-NOT: __emutls_t.external_x:
|
|
; CHECK-NOT: __emutls_t.internal_y0:
|
|
; CHECK-NOT: global __emutls_t.external_y
|
|
; CHECK-NOT: global __emutls_v.internal_y
|
|
; CHECK-NOT: global __emutls_v.internal_y0
|