1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
3 ; RUN: -mcpu=pwr8 -code-model=large < %s | FileCheck %s
4 %struct.STATICS1 = type <{ [128 x i8] }>
6 @.STATICS1 = internal global %struct.STATICS1 <{ [128 x i8] c"\09\00\00\00\03\00\00\00\05\00\00\00\04\00\00\00\0A\00\00\00\0A\00\00\00\0B\00\00\00\0A\08\AF/\B8\B6\87\04 \A1\07\00\08\9D\00\00\09\00\00\00\05\00\00\00\03\00\00\00\03\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>, align 16
7 @.C302_MAIN_ = internal constant i32 4
9 ; Function Attrs: noinline norecurse nounwind
12 ; CHECK: # %bb.0: # %L.entry
14 ; CHECK-NEXT: std 0, 16(1)
15 ; CHECK-NEXT: stdu 1, -32(1)
16 ; CHECK-NEXT: .cfi_def_cfa_offset 32
17 ; CHECK-NEXT: .cfi_offset lr, 16
18 ; CHECK-NEXT: addis 3, 2, .LC0@toc@ha
19 ; CHECK-NEXT: addis 4, 2, .LC1@toc@ha
20 ; CHECK-NEXT: ld 3, .LC0@toc@l(3)
21 ; CHECK-NEXT: ld 4, .LC1@toc@l(4)
22 ; CHECK-NEXT: addi 3, 3, 124
23 ; CHECK-NEXT: bl testFunc
25 ; CHECK-NEXT: addi 1, 1, 32
26 ; CHECK-NEXT: ld 0, 16(1)
30 tail call void @testFunc(i64* bitcast (i8* getelementptr inbounds (%struct.STATICS1, %struct.STATICS1* @.STATICS1, i64 0, i32 0, i64 124) to i64*), i64* bitcast (i32* @.C302_MAIN_ to i64*))
34 ; Function Attrs: noinline norecurse nounwind readonly
35 define signext i32 @ifunc_(i64* nocapture readonly %i) {
36 ; CHECK-LABEL: ifunc_:
37 ; CHECK: # %bb.0: # %L.entry
38 ; CHECK-NEXT: lwa 3, 0(3)
41 %0 = bitcast i64* %i to i32*
42 %1 = load i32, i32* %0, align 4
46 ; Function Attrs: noinline norecurse nounwind
47 define void @testFunc(i64* nocapture %r, i64* nocapture readonly %k) {
48 ; CHECK-LABEL: testFunc:
49 ; CHECK: # %bb.0: # %L.entry
51 ; CHECK-NEXT: std 0, 16(1)
52 ; CHECK-NEXT: stdu 1, -32(1)
53 ; CHECK-NEXT: .cfi_def_cfa_offset 32
54 ; CHECK-NEXT: .cfi_offset lr, 16
55 ; CHECK-NEXT: bl .L2$pb
57 ; CHECK-NEXT: lwz 4, 0(4)
59 ; CHECK-NEXT: addi 4, 4, -1
60 ; CHECK-NEXT: cmplwi 4, 5
61 ; CHECK-NEXT: bgt 0, .LBB2_6
62 ; CHECK-NEXT: # %bb.1: # %L.entry
63 ; CHECK-NEXT: addis 6, 2, .LC2@toc@ha
64 ; CHECK-NEXT: rldic 4, 4, 2, 30
65 ; CHECK-NEXT: ld 6, .LC2@toc@l(6)
66 ; CHECK-NEXT: lwax 4, 4, 6
67 ; CHECK-NEXT: add 4, 4, 5
69 ; CHECK-NEXT: li 4, -3
71 ; CHECK-NEXT: .p2align 4
72 ; CHECK-NEXT: .LBB2_2: # %infloop11
74 ; CHECK-NEXT: b .LBB2_2
75 ; CHECK-NEXT: .p2align 4
76 ; CHECK-NEXT: .LBB2_3: # %infloop
78 ; CHECK-NEXT: b .LBB2_3
79 ; CHECK-NEXT: .LBB2_4: # %L.LB3_321.split
81 ; CHECK-NEXT: .LBB2_5: # %L.LB3_307.sink.split
82 ; CHECK-NEXT: stw 4, 0(3)
83 ; CHECK-NEXT: .LBB2_6: # %L.LB3_307
84 ; CHECK-NEXT: addi 1, 1, 32
85 ; CHECK-NEXT: ld 0, 16(1)
89 %0 = bitcast i64* %k to i32*
90 %1 = load i32, i32* %0, align 4
91 switch i32 %1, label %L.LB3_307 [
92 i32 1, label %L.LB3_307.sink.split
93 i32 3, label %L.LB3_307.sink.split
94 i32 4, label %L.LB3_321.split
95 i32 5, label %L.LB3_307.sink.split
96 i32 6, label %infloop.preheader
97 i32 2, label %infloop11.preheader
100 infloop11.preheader: ; preds = %L.entry
103 infloop.preheader: ; preds = %L.entry
106 L.LB3_321.split: ; preds = %L.entry
107 br label %L.LB3_307.sink.split
109 L.LB3_307.sink.split: ; preds = %L.LB3_321.split, %L.entry, %L.entry, %L.entry
110 %.sink = phi i32 [ 5, %L.LB3_321.split ], [ -3, %L.entry ], [ -3, %L.entry ], [ -3, %L.entry ]
111 %2 = bitcast i64* %r to i32*
112 store i32 %.sink, i32* %2, align 4
115 L.LB3_307: ; preds = %L.LB3_307.sink.split, %L.entry
118 infloop: ; preds = %infloop.preheader, %infloop
121 infloop11: ; preds = %infloop11.preheader, %infloop11