xref: /llvm-project/llvm/test/CodeGen/PowerPC/tls_get_addr_fence2.mir (revision 60442f0d442723a487528bdd8b48b24657a025e8)
1# ADJCALLSTACKDOWN and ADJCALLSTACKUP should not be generated around TLS pseudo code if it is located within existing ADJCALLSTACKDOWN/ADJCALLSTACKUP pair.
2# RUN: llc -mtriple=powerpc64le-linux-gnu -run-pass=ppc-tls-dynamic-call -verify-machineinstrs -o - %s | FileCheck %s
3
4--- |
5  target datalayout = "e-m:e-i64:64-n32:64"
6  target triple = "powerpc64le-unknown-linux-gnu"
7
8  @tls_var = external thread_local local_unnamed_addr global i32
9
10  define i32 @tls_func() local_unnamed_addr {
11  entry:
12    %0 = load i32, ptr @tls_var
13    ret i32 %0
14  }
15
16...
17---
18name:            tls_func
19alignment:       16
20exposesReturnsTwice: false
21legalized:       false
22regBankSelected: false
23selected:        false
24tracksRegLiveness: true
25registers:
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: '' }
29liveins:
30  - { reg: '$x2' }
31frameInfo:
32  isFrameAddressTaken: false
33  isReturnAddressTaken: false
34  hasStackMap:     false
35  hasPatchPoint:   false
36  stackSize:       0
37  offsetAdjustment: 0
38  maxAlignment:    0
39  adjustsStack:    false
40  hasCalls:        false
41  stackProtector:  ''
42  maxCallFrameSize: 4294967295
43  hasOpaqueSPAdjustment: false
44  hasVAStart:      false
45  hasMustTailInVarArgFunc: false
46  savePoint:       ''
47  restorePoint:    ''
48fixedStack:
49stack:
50constants:
51body:             |
52  bb.0.entry:
53    liveins: $x2
54    ADJCALLSTACKDOWN 32, 0, implicit-def $r1, implicit $r1
55    %0 = ADDIStlsgdHA $x2, @tls_var
56    %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
57    %2 = LWZ8 0, killed %1 :: (dereferenceable load (s32) from @tls_var)
58    $x3 = COPY %2
59    ADJCALLSTACKUP 32, 0, implicit-def $r1, implicit $r1
60    BLR8 implicit $lr8, implicit $rm, implicit $x3
61    ; CHECK-LABEL: bb.0.entry
62    ; CHECK-NOT: ADJCALLSTACKDOWN 0, 0
63    ; CHECK-NOT: ADJCALLSTACKUP 0, 0
64    ; CHECK: BLR8
65...
66