1 # ADJCALLSTACKDOWN and ADJCALLSTACKUP must be generated around TLS pseudo code as scheduling fence (PR25839).
2 # RUN: llc -mtriple=powerpc64le-linux-gnu -run-pass=ppc-tls-dynamic-call -verify-machineinstrs -o - %s | FileCheck %s
5 target datalayout = "e-m:e-i64:64-n32:64"
6 target triple = "powerpc64le-unknown-linux-gnu"
8 @tls_var = external thread_local local_unnamed_addr global i32
10 define i32 @tls_func() local_unnamed_addr {
12 %0 = load i32, i32* @tls_var
20 exposesReturnsTwice: false
22 regBankSelected: false
24 tracksRegLiveness: true
26 - { id: 0, class: g8rc_and_g8rc_nox0, preferred-register: '' }
27 - { id: 1, class: g8rc_and_g8rc_nox0, preferred-register: '' }
28 - { id: 2, class: g8rc, preferred-register: '' }
32 isFrameAddressTaken: false
33 isReturnAddressTaken: false
42 maxCallFrameSize: 4294967295
43 hasOpaqueSPAdjustment: false
45 hasMustTailInVarArgFunc: false
54 %0 = ADDIStlsgdHA $x2, @tls_var
55 %1 = ADDItlsgdLADDR killed %0, @tls_var, @tls_var, implicit-def dead $x0, implicit-def dead $x3, implicit-def dead $x4, implicit-def dead $x5, implicit-def dead $x6, implicit-def dead $x7, implicit-def dead $x8, implicit-def dead $x9, implicit-def dead $x10, implicit-def dead $x11, implicit-def dead $x12, implicit-def dead $lr8, implicit-def dead $ctr8, implicit-def dead $cr0, implicit-def dead $cr1, implicit-def dead $cr5, implicit-def dead $cr6, implicit-def dead $cr7
56 %2 = LWZ8 0, killed %1 :: (dereferenceable load 4 from @tls_var)
58 BLR8 implicit $lr8, implicit $rm, implicit $x3
59 ; CHECK-LABEL: bb.0.entry
60 ; CHECK: %[[reg1:[0-9]+]]:g8rc_and_g8rc_nox0 = ADDIStlsgdHA $x2, @tls_var
61 ; CHECK: ADJCALLSTACKDOWN 0, 0
62 ; CHECK: $x3 = ADDItlsgdL %[[reg1]], @tls_var
63 ; CHECK: $x3 = GETtlsADDR $x3, @tls_var
64 ; CHECK: ADJCALLSTACKUP 0, 0