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: stdu 1, -32(1)
15 ; CHECK-NEXT: std 0, 48(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 5, 2, .LC1@toc@ha
20 ; CHECK-NEXT: ld 4, .LC0@toc@l(3)
21 ; CHECK-NEXT: ld 3, .LC1@toc@l(5)
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(ptr getelementptr inbounds (%struct.STATICS1, ptr @.STATICS1, i64 0, i32 0, i64 124), ptr @.C302_MAIN_)
34 ; Function Attrs: noinline norecurse nounwind readonly
35 define signext i32 @ifunc_(ptr nocapture readonly %i) {
36 ; CHECK-LABEL: ifunc_:
37 ; CHECK: # %bb.0: # %L.entry
38 ; CHECK-NEXT: lwa 3, 0(3)
41 %0 = load i32, ptr %i, align 4
45 ; Function Attrs: noinline norecurse nounwind
46 define void @testFunc(ptr nocapture %r, ptr nocapture readonly %k) {
47 ; CHECK-LABEL: testFunc:
48 ; CHECK: # %bb.0: # %L.entry
49 ; CHECK-NEXT: lwz 5, 0(4)
50 ; CHECK-NEXT: li 4, -3
51 ; CHECK-NEXT: cmpwi 5, 4
52 ; CHECK-NEXT: bge 0, .LBB2_6
53 ; CHECK-NEXT: # %bb.1: # %L.entry
54 ; CHECK-NEXT: cmplwi 5, 1
55 ; CHECK-NEXT: beq 0, .LBB2_11
56 ; CHECK-NEXT: # %bb.2: # %L.entry
57 ; CHECK-NEXT: cmplwi 5, 2
58 ; CHECK-NEXT: beq 0, .LBB2_5
59 ; CHECK-NEXT: # %bb.3: # %L.entry
60 ; CHECK-NEXT: cmplwi 5, 3
61 ; CHECK-NEXT: beq 0, .LBB2_11
62 ; CHECK-NEXT: # %bb.4: # %L.LB3_307
64 ; CHECK-NEXT: .p2align 4
65 ; CHECK-NEXT: .LBB2_5: # %infloop11
67 ; CHECK-NEXT: b .LBB2_5
68 ; CHECK-NEXT: .LBB2_6: # %L.entry
69 ; CHECK-NEXT: beq 0, .LBB2_10
70 ; CHECK-NEXT: # %bb.7: # %L.entry
71 ; CHECK-NEXT: cmplwi 5, 5
72 ; CHECK-NEXT: beq 0, .LBB2_11
73 ; CHECK-NEXT: # %bb.8: # %L.entry
74 ; CHECK-NEXT: cmplwi 5, 6
76 ; CHECK-NEXT: .p2align 4
77 ; CHECK-NEXT: .LBB2_9: # %infloop
79 ; CHECK-NEXT: b .LBB2_9
80 ; CHECK-NEXT: .LBB2_10: # %L.LB3_321.split
82 ; CHECK-NEXT: .LBB2_11: # %L.LB3_307.sink.split
83 ; CHECK-NEXT: stw 4, 0(3)
86 %0 = load i32, ptr %k, align 4
87 switch i32 %0, label %L.LB3_307 [
88 i32 1, label %L.LB3_307.sink.split
89 i32 3, label %L.LB3_307.sink.split
90 i32 4, label %L.LB3_321.split
91 i32 5, label %L.LB3_307.sink.split
92 i32 6, label %infloop.preheader
93 i32 2, label %infloop11.preheader
96 infloop11.preheader: ; preds = %L.entry
99 infloop.preheader: ; preds = %L.entry
102 L.LB3_321.split: ; preds = %L.entry
103 br label %L.LB3_307.sink.split
105 L.LB3_307.sink.split: ; preds = %L.LB3_321.split, %L.entry, %L.entry, %L.entry
106 %.sink = phi i32 [ 5, %L.LB3_321.split ], [ -3, %L.entry ], [ -3, %L.entry ], [ -3, %L.entry ]
107 store i32 %.sink, ptr %r, align 4
110 L.LB3_307: ; preds = %L.LB3_307.sink.split, %L.entry
113 infloop: ; preds = %infloop.preheader, %infloop
116 infloop11: ; preds = %infloop11.preheader, %infloop11