1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names \
3; RUN:   -mtriple=powerpc64le-unknown-unknown -verify-machineinstrs < %s | \
4; RUN:   FileCheck %s
5
6%0 = type { [0 x i64], %1, [0 x i64], { i64, i8* }, [0 x i64] }
7%1 = type { [0 x i64], %2, [0 x i64], i64*, [0 x i64] }
8%2 = type { [0 x i64], %3, [0 x i64], %4, [0 x i8], i8, [7 x i8] }
9%3 = type { [0 x i64], { i64*, i64* }, [0 x i64], i64*, [0 x i8], i8, [7 x i8] }
10%4 = type { [0 x i64], { i64*, i64* }, [0 x i64], %5, [0 x i64] }
11%5 = type { [0 x i64], { i64*, i64* }, [0 x i64], i64*, [0 x i64] }
12%6 = type { [0 x i64], i64, [2 x i64] }
13%7 = type { [0 x i64], { i64*, i64* }, [0 x i64], %8, [0 x i64] }
14%8 = type { [0 x i64], %9*, [0 x i32], { i32, i32 }, [0 x i8], i8, [7 x i8] }
15%9 = type { [0 x i64], i64, [0 x i64], [0 x %10], [0 x i8], %11 }
16%10 = type { [0 x i8], i8, [31 x i8] }
17%11 = type {}
18%12 = type { [0 x i64], %13, [0 x i32], i32, [0 x i32], i32, [0 x i32] }
19%13 = type { [0 x i8], i8, [23 x i8] }
20%14 = type { [0 x i64], i64, [0 x i64], %15, [0 x i32], i32, [0 x i8], i8, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [0 x i8], { i8, i8 }, [7 x i8] }
21%15 = type { [0 x i64], { i64*, i64 }, [0 x i64], i64, [0 x i64] }
22%16 = type { [0 x i64], %17, [0 x i64], %18, [0 x i64], %19, [0 x i64], i64, [0 x i8], { i8, i8 }, [6 x i8] }
23%17 = type { [0 x i32], i32, [27 x i32] }
24%18 = type { [0 x i64], i64, [6 x i64] }
25%19 = type { [0 x i8], i8, [103 x i8] }
26%20 = type { [0 x i64], { i64*, i64* }*, [0 x i64], %7**, [0 x i64], i64**, [0 x i64] }
27%21 = type { [0 x i64], i64, [0 x i64], void (i32, %21*)*, [0 x i64], [2 x i64], [0 x i64] }
28%22 = type { [0 x i8] }
29
30@var = external dso_local unnamed_addr constant <{ i8*, [8 x i8], i8*, [16 x i8] }>, align 8
31
32declare dso_local fastcc { i64*, i8* } @test2(%0**) unnamed_addr
33
34define void @test(%6* %arg, %7* %arg1, %12* %arg2) unnamed_addr personality i32 (i32, i32, i64, %21*, %22*)* @personality {
35; CHECK-LABEL: test:
36; CHECK:         .cfi_personality 148, DW.ref.personality
37; CHECK-NEXT:    .cfi_lsda 20, .Lexception0
38; CHECK-NEXT:  .Lfunc_gep0:
39; CHECK-NEXT:    addis r2, r12, .TOC.-.Lfunc_gep0@ha
40; CHECK-NEXT:    addi r2, r2, .TOC.-.Lfunc_gep0@l
41; CHECK-NEXT:  .Lfunc_lep0:
42; CHECK-NEXT:    .localentry test, .Lfunc_lep0-.Lfunc_gep0
43; CHECK-NEXT:  # %bb.0: # %bb
44; CHECK-NEXT:    mflr r0
45; CHECK-NEXT:    std r0, 16(r1)
46; CHECK-NEXT:    stdu r1, -32(r1)
47; CHECK-NEXT:    .cfi_def_cfa_offset 32
48; CHECK-NEXT:    .cfi_offset lr, 16
49; CHECK-NEXT:    li r3, 0
50; CHECK-NEXT:  # %bb.1: # %bb9
51; CHECK-NEXT:    bl test5
52; CHECK-NEXT:    nop
53; CHECK-NEXT:    rlwinm r3, r3, 8, 16, 23
54; CHECK-NEXT:  # %bb.2: # %bb12
55; CHECK-NEXT:    clrldi r4, r3, 32
56; CHECK-NEXT:    bl test3
57; CHECK-NEXT:    nop
58; CHECK-NEXT:    addi r1, r1, 32
59; CHECK-NEXT:    ld r0, 16(r1)
60; CHECK-NEXT:    mtlr r0
61; CHECK-NEXT:    blr
62bb:
63  switch i64 undef, label %bb21 [
64    i64 3, label %bb3
65  ]
66
67bb3:                                              ; preds = %bb
68  switch i3 undef, label %bb4 [
69    i3 0, label %bb9
70    i3 1, label %bb12
71  ]
72
73bb4:                                              ; preds = %bb3
74  unreachable
75
76bb5:                                              ; No predecessors!
77  br label %bb12
78
79bb6:                                              ; No predecessors!
80  br label %bb12
81
82bb7:                                              ; No predecessors!
83  br label %bb12
84
85bb8:                                              ; No predecessors!
86  br label %bb12
87
88bb9:                                              ; preds = %bb3
89  %tmp = call i8 @test5(%14* noalias nonnull readonly align 8 dereferenceable(64) undef), !range !0
90  %tmp10 = zext i8 %tmp to i24
91  %tmp11 = shl nuw nsw i24 %tmp10, 8
92  br label %bb12
93
94bb12:                                             ; preds = %bb9, %bb8, %bb7, %bb6, %bb5, %bb3
95  %tmp13 = phi i24 [ 1024, %bb8 ], [ 768, %bb7 ], [ 512, %bb6 ], [ 256, %bb5 ], [ %tmp11, %bb9 ], [ 0, %bb3 ]
96  %tmp14 = call fastcc align 8 dereferenceable(288) %16* @test3(%20* noalias nonnull readonly align 8 dereferenceable(24) undef, i24 %tmp13)
97  br label %bb22
98
99bb15:                                             ; No predecessors!
100  %tmp16 = invoke fastcc { i64*, i8* } @test2(%0** nonnull align 8 dereferenceable(8) undef)
101          to label %bb17 unwind label %bb18
102
103bb17:                                             ; preds = %bb15
104  invoke void @test4({ [0 x i64], { [0 x i8]*, i64 }, [0 x i64], { [0 x i8]*, i64 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }* noalias readonly align 8 dereferenceable(40) bitcast (<{ i8*, [8 x i8], i8*, [16 x i8] }>* @var to { [0 x i64], { [0 x i8]*, i64 }, [0 x i64], { [0 x i8]*, i64 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }*))
105          to label %bb23 unwind label %bb25
106
107bb18:                                             ; preds = %bb15
108  %tmp19 = landingpad { i8*, i32 }
109          cleanup
110  resume { i8*, i32 } undef
111
112bb20:                                             ; No predecessors!
113  invoke void @test4({ [0 x i64], { [0 x i8]*, i64 }, [0 x i64], { [0 x i8]*, i64 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }* noalias readonly align 8 dereferenceable(40) bitcast (<{ i8*, [8 x i8], i8*, [16 x i8] }>* @var to { [0 x i64], { [0 x i8]*, i64 }, [0 x i64], { [0 x i8]*, i64 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }*))
114          to label %bb24 unwind label %bb25
115
116bb21:                                             ; preds = %bb
117  unreachable
118
119bb22:                                             ; preds = %bb12
120  ret void
121
122bb23:                                             ; preds = %bb17
123  unreachable
124
125bb24:                                             ; preds = %bb20
126  unreachable
127
128bb25:                                             ; preds = %bb20, %bb17
129  %tmp26 = landingpad { i8*, i32 }
130          cleanup
131  resume { i8*, i32 } undef
132}
133
134declare dso_local fastcc %16* @test3(%20*, i24) unnamed_addr
135
136declare i32 @personality(i32, i32, i64, %21*, %22*) unnamed_addr
137
138declare void @test4({ [0 x i64], { [0 x i8]*, i64 }, [0 x i64], { [0 x i8]*, i64 }, [0 x i32], i32, [0 x i32], i32, [0 x i32] }*) unnamed_addr
139
140declare i8 @test5(%14*) unnamed_addr
141
142!0 = !{i8 0, i8 5}
143