1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
7 ; RUN: FileCheck %s --check-prefix=CHECK-BE
12 %100 = type <{ i8, i8, i8, i8, i32, i64, i64, [1 x i64], [1 x i64], [1 x i64] }>
13 %101 = type <{ i8, i8, i8, i8, i32, i64, i64, [1 x i64], [1 x i64], [1 x i64], [24 x i8] }>
14 %102 = type <{ i8, i8, i8, i8, i32, i64, i64, [1 x i64], [1 x i64], [1 x i64] }>
15 %103 = type <{ ptr, i8, i8, i8, i8, [4 x i8], i32, [12 x i8], i32, [4 x i8] }>
20 ; Function Attrs: nobuiltin norecurse
21 define dso_local signext i32 @test_FI_elim(ptr noalias nocapture dereferenceable(40) %arg, ptr noalias nocapture nonnull readonly %arg2, ptr noalias nocapture nonnull readonly %arg3, ptr noalias nocapture nonnull readonly %arg4, ptr noalias nocapture dereferenceable(48) %arg6, ptr noalias nocapture dereferenceable(72) %arg7) local_unnamed_addr #2 {
22 ; CHECK-LABEL: test_FI_elim:
23 ; CHECK: # %bb.0: # %bb
25 ; CHECK-NEXT: std r0, 16(r1)
26 ; CHECK-NEXT: stdu r1, -80(r1)
27 ; CHECK-NEXT: .cfi_def_cfa_offset 80
28 ; CHECK-NEXT: .cfi_offset lr, 16
29 ; CHECK-NEXT: lxv v2, 0(r3)
30 ; CHECK-NEXT: mr r9, r6
31 ; CHECK-NEXT: mr r6, r5
32 ; CHECK-NEXT: li r12, -127
33 ; CHECK-NEXT: li r0, 4
34 ; CHECK-NEXT: stb r12, 0(r3)
35 ; CHECK-NEXT: li r2, 1
36 ; CHECK-NEXT: std r0, 0(r3)
37 ; CHECK-NEXT: stw r2, 0(r3)
38 ; CHECK-NEXT: li r11, 3
39 ; CHECK-NEXT: stb r11, 0(0)
40 ; CHECK-NEXT: mfvsrd r5, v2
41 ; CHECK-NEXT: vaddudm v3, v2, v2
42 ; CHECK-NEXT: pstxv v2, 64(r1), 0
43 ; CHECK-NEXT: neg r5, r5
44 ; CHECK-NEXT: mfvsrd r10, v3
45 ; CHECK-NEXT: std r5, 0(r3)
46 ; CHECK-NEXT: lbz r5, 2(r7)
47 ; CHECK-NEXT: mr r7, r9
48 ; CHECK-NEXT: stb r11, 0(r3)
49 ; CHECK-NEXT: stb r12, 0(r3)
50 ; CHECK-NEXT: std r2, 0(r3)
51 ; CHECK-NEXT: neg r10, r10
52 ; CHECK-NEXT: rlwinm r5, r5, 0, 27, 27
53 ; CHECK-NEXT: stb r5, 0(0)
54 ; CHECK-NEXT: lbz r5, 2(r8)
55 ; CHECK-NEXT: rlwinm r5, r5, 0, 27, 27
56 ; CHECK-NEXT: stb r5, 0(r3)
57 ; CHECK-NEXT: li r5, 2
58 ; CHECK-NEXT: std r0, 0(r3)
59 ; CHECK-NEXT: stw r5, 0(r3)
60 ; CHECK-NEXT: mr r5, r4
61 ; CHECK-NEXT: std r10, 0(r3)
62 ; CHECK-NEXT: bl foo@notoc
63 ; CHECK-NEXT: extsw r3, r3
64 ; CHECK-NEXT: addi r1, r1, 80
65 ; CHECK-NEXT: ld r0, 16(r1)
69 ; CHECK-BE-LABEL: test_FI_elim:
70 ; CHECK-BE: # %bb.0: # %bb
71 ; CHECK-BE-NEXT: mflr r0
72 ; CHECK-BE-NEXT: std r0, 16(r1)
73 ; CHECK-BE-NEXT: stdu r1, -176(r1)
74 ; CHECK-BE-NEXT: .cfi_def_cfa_offset 176
75 ; CHECK-BE-NEXT: .cfi_offset lr, 16
76 ; CHECK-BE-NEXT: .cfi_offset r30, -16
77 ; CHECK-BE-NEXT: lxv v2, 0(r3)
78 ; CHECK-BE-NEXT: mr r9, r6
79 ; CHECK-BE-NEXT: mr r6, r5
80 ; CHECK-BE-NEXT: std r30, 160(r1) # 8-byte Folded Spill
81 ; CHECK-BE-NEXT: li r12, -127
82 ; CHECK-BE-NEXT: li r0, 4
83 ; CHECK-BE-NEXT: stb r12, 0(r3)
84 ; CHECK-BE-NEXT: li r30, 1
85 ; CHECK-BE-NEXT: std r0, 0(r3)
86 ; CHECK-BE-NEXT: stw r30, 0(r3)
87 ; CHECK-BE-NEXT: li r11, 3
88 ; CHECK-BE-NEXT: stb r11, 0(0)
89 ; CHECK-BE-NEXT: mfvsrld r5, v2
90 ; CHECK-BE-NEXT: vaddudm v3, v2, v2
91 ; CHECK-BE-NEXT: pstxv v2, 144(r1), 0
92 ; CHECK-BE-NEXT: mfvsrld r10, v3
93 ; CHECK-BE-NEXT: neg r5, r5
94 ; CHECK-BE-NEXT: std r5, 0(r3)
95 ; CHECK-BE-NEXT: lbz r5, 2(r7)
96 ; CHECK-BE-NEXT: mr r7, r9
97 ; CHECK-BE-NEXT: stb r11, 0(r3)
98 ; CHECK-BE-NEXT: stb r12, 0(r3)
99 ; CHECK-BE-NEXT: std r30, 0(r3)
100 ; CHECK-BE-NEXT: neg r10, r10
101 ; CHECK-BE-NEXT: rlwinm r5, r5, 0, 27, 27
102 ; CHECK-BE-NEXT: stb r5, 0(0)
103 ; CHECK-BE-NEXT: lbz r5, 2(r8)
104 ; CHECK-BE-NEXT: rlwinm r5, r5, 0, 27, 27
105 ; CHECK-BE-NEXT: stb r5, 0(r3)
106 ; CHECK-BE-NEXT: li r5, 2
107 ; CHECK-BE-NEXT: std r0, 0(r3)
108 ; CHECK-BE-NEXT: stw r5, 0(r3)
109 ; CHECK-BE-NEXT: mr r5, r4
110 ; CHECK-BE-NEXT: std r10, 0(r3)
111 ; CHECK-BE-NEXT: bl foo
113 ; CHECK-BE-NEXT: ld r30, 160(r1) # 8-byte Folded Reload
114 ; CHECK-BE-NEXT: extsw r3, r3
115 ; CHECK-BE-NEXT: addi r1, r1, 176
116 ; CHECK-BE-NEXT: ld r0, 16(r1)
117 ; CHECK-BE-NEXT: mtlr r0
120 %i = alloca %102, align 8
121 %i8 = load <2 x i64>, ptr undef, align 8
122 %i9 = extractelement <2 x i64> %i8, i32 1
123 %i10 = sub i64 0, %i9
124 %i11 = load <2 x i64>, ptr undef, align 8
125 %i12 = load <2 x i64>, ptr undef, align 8
126 %i13 = add nsw <2 x i64> %i11, %i12
127 %i14 = extractelement <2 x i64> %i13, i32 1
128 %i15 = sub i64 0, %i14
129 store i8 3, ptr null, align 8
130 store i8 -127, ptr undef, align 1
131 store i64 4, ptr undef, align 8
132 store i32 1, ptr undef, align 4
133 %i16 = getelementptr inbounds %102, ptr %i, i64 0, i32 8, i64 0
134 store <2 x i64> %i8, ptr %i16, align 8
135 store i64 %i10, ptr undef, align 8
136 store i8 3, ptr undef, align 8
137 %i18 = getelementptr inbounds %100, ptr %arg6, i64 0, i32 2
138 %i19 = load i8, ptr %i18, align 1
139 %i20 = and i8 %i19, 16
140 store i8 %i20, ptr null, align 2
141 store i8 -127, ptr undef, align 1
142 store i64 1, ptr undef, align 8
143 %i21 = getelementptr inbounds %101, ptr %arg7, i64 0, i32 2
144 %i22 = load i8, ptr %i21, align 1
145 %i23 = and i8 %i22, 16
146 store i8 %i23, ptr undef, align 2
147 store i64 4, ptr undef, align 8
148 store i32 2, ptr undef, align 4
149 store i64 %i15, ptr undef, align 8
150 %i28 = call i32 @foo(ptr nonnull %arg, ptr nonnull undef, ptr %arg2, ptr %arg3, ptr %arg4)
154 declare dso_local i32 @foo(ptr, ptr, ptr, ptr, ptr) local_unnamed_addr #1