1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -relocation-model=pic -verify-machineinstrs < %s \
3 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
4 %struct.e.0.12.28.44.104.108.112.188 = type { i32 }
5 %struct.t.1.13.29.45.105.109.113.189 = type { i64, i64 }
7 @g = external local_unnamed_addr global %struct.e.0.12.28.44.104.108.112.188, align 4
8 @aj = external thread_local local_unnamed_addr global %struct.t.1.13.29.45.105.109.113.189, align 8
10 define void @_ZNK1q1rEv() local_unnamed_addr #0 align 2 {
11 ; CHECK-LABEL: _ZNK1q1rEv:
12 ; CHECK: # %bb.0: # %entry
14 ; CHECK-NEXT: std 29, -24(1) # 8-byte Folded Spill
15 ; CHECK-NEXT: std 30, -16(1) # 8-byte Folded Spill
16 ; CHECK-NEXT: std 0, 16(1)
17 ; CHECK-NEXT: stdu 1, -64(1)
18 ; CHECK-NEXT: lwz 30, 0(3)
19 ; CHECK-NEXT: addis 3, 2, .LC0@toc@ha
20 ; CHECK-NEXT: ld 29, .LC0@toc@l(3)
21 ; CHECK-NEXT: addis 3, 2, aj@got@tlsgd@ha
22 ; CHECK-NEXT: addi 3, 3, aj@got@tlsgd@l
23 ; CHECK-NEXT: bl __tls_get_addr(aj@tlsgd)
25 ; CHECK-NEXT: addi 4, 3, 8
26 ; CHECK-NEXT: .p2align 5
27 ; CHECK-NEXT: .LBB0_1: # %monotonic.i
29 ; CHECK-NEXT: lwz 5, 0(29)
30 ; CHECK-NEXT: andi. 5, 5, 255
31 ; CHECK-NEXT: bne 0, .LBB0_4
32 ; CHECK-NEXT: # %bb.2: # %for.cond.i
34 ; CHECK-NEXT: addi 30, 30, -1
35 ; CHECK-NEXT: cmplwi 30, 0
36 ; CHECK-NEXT: bne 0, .LBB0_1
37 ; CHECK-NEXT: # %bb.3:
39 ; CHECK-NEXT: .LBB0_4: # %if.end
41 ; CHECK-NEXT: std 3, 0(4)
42 ; CHECK-NEXT: addi 1, 1, 64
43 ; CHECK-NEXT: ld 0, 16(1)
44 ; CHECK-NEXT: ld 30, -16(1) # 8-byte Folded Reload
45 ; CHECK-NEXT: ld 29, -24(1) # 8-byte Folded Reload
49 %0 = load i32, i32* undef, align 4
52 for.cond.i: ; preds = %monotonic.i
53 %exitcond.not = icmp eq i32 %inc.i, %0
54 br i1 %exitcond.not, label %if.end, label %monotonic.i
56 monotonic.i: ; preds = %for.cond.i, %entry
57 %i.018.i = phi i32 [ %inc.i, %for.cond.i ], [ 0, %entry ]
58 %1 = load atomic i32, i32* getelementptr inbounds (%struct.e.0.12.28.44.104.108.112.188, %struct.e.0.12.28.44.104.108.112.188* @g, i64 0, i32 0) monotonic, align 4
59 %conv.i = trunc i32 %1 to i8
60 %tobool.not.i = icmp eq i8 %conv.i, 0
61 %inc.i = add nuw nsw i32 %i.018.i, 1
62 br i1 %tobool.not.i, label %for.cond.i, label %if.end
64 if.end: ; preds = %monotonic.i, %for.cond.i
65 %.sink = phi i64* [ getelementptr inbounds (%struct.t.1.13.29.45.105.109.113.189, %struct.t.1.13.29.45.105.109.113.189* @aj, i64 0, i32 1), %monotonic.i ], [ getelementptr inbounds (%struct.t.1.13.29.45.105.109.113.189, %struct.t.1.13.29.45.105.109.113.189* @aj, i64 0, i32 0), %for.cond.i ]
66 store i64 1, i64* %.sink, align 8
70 attributes #0 = { nounwind }