comparison test/CodeGen/PowerPC/fast-isel-cmp-imm.ll @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children c2174574ed3a
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
1 ; FIXME: FastISel currently returns false if it hits code that uses VSX 1 ; FIXME: FastISel currently returns false if it hits code that uses VSX
2 ; registers and with -fast-isel-abort turned on the test case will then fail. 2 ; registers and with -fast-isel-abort=1 turned on the test case will then fail.
3 ; When fastisel better supports VSX fix up this test case. 3 ; When fastisel better supports VSX fix up this test case.
4 ; 4 ;
5 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64 5 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
6 define void @t1a(float %a) uwtable ssp { 6 define void @t1a(float %a) nounwind {
7 entry: 7 entry:
8 ; ELF64: t1a 8 ; ELF64: t1a
9 %cmp = fcmp oeq float %a, 0.000000e+00 9 %cmp = fcmp oeq float %a, 0.000000e+00
10 ; ELF64: addis 10 ; ELF64: addis
11 ; ELF64: lfs 11 ; ELF64: lfs
20 ret void 20 ret void
21 } 21 }
22 22
23 declare void @foo() 23 declare void @foo()
24 24
25 define void @t1b(float %a) uwtable ssp { 25 define void @t1b(float %a) nounwind {
26 entry: 26 entry:
27 ; ELF64: t1b 27 ; ELF64: t1b
28 %cmp = fcmp oeq float %a, -0.000000e+00 28 %cmp = fcmp oeq float %a, -0.000000e+00
29 ; ELF64: addis 29 ; ELF64: addis
30 ; ELF64: lfs 30 ; ELF64: lfs
37 37
38 if.end: ; preds = %if.then, %entry 38 if.end: ; preds = %if.then, %entry
39 ret void 39 ret void
40 } 40 }
41 41
42 define void @t2a(double %a) uwtable ssp { 42 define void @t2a(double %a) nounwind {
43 entry: 43 entry:
44 ; ELF64: t2a 44 ; ELF64: t2a
45 %cmp = fcmp oeq double %a, 0.000000e+00 45 %cmp = fcmp oeq double %a, 0.000000e+00
46 ; ELF64: addis 46 ; ELF64: addis
47 ; ELF64: lfd 47 ; ELF64: lfd
54 54
55 if.end: ; preds = %if.then, %entry 55 if.end: ; preds = %if.then, %entry
56 ret void 56 ret void
57 } 57 }
58 58
59 define void @t2b(double %a) uwtable ssp { 59 define void @t2b(double %a) nounwind {
60 entry: 60 entry:
61 ; ELF64: t2b 61 ; ELF64: t2b
62 %cmp = fcmp oeq double %a, -0.000000e+00 62 %cmp = fcmp oeq double %a, -0.000000e+00
63 ; ELF64: addis 63 ; ELF64: addis
64 ; ELF64: lfd 64 ; ELF64: lfd
71 71
72 if.end: ; preds = %if.then, %entry 72 if.end: ; preds = %if.then, %entry
73 ret void 73 ret void
74 } 74 }
75 75
76 define void @t4(i8 signext %a) uwtable ssp { 76 define void @t4(i8 signext %a) nounwind {
77 entry: 77 entry:
78 ; ELF64: t4 78 ; ELF64: t4
79 %cmp = icmp eq i8 %a, -1 79 %cmp = icmp eq i8 %a, -1
80 ; ELF64: extsb 80 ; ELF64: extsb
81 ; ELF64: cmpwi 81 ; ELF64: cmpwi
87 87
88 if.end: ; preds = %if.then, %entry 88 if.end: ; preds = %if.then, %entry
89 ret void 89 ret void
90 } 90 }
91 91
92 define void @t5(i8 zeroext %a) uwtable ssp { 92 define void @t5(i8 zeroext %a) nounwind {
93 entry: 93 entry:
94 ; ELF64: t5 94 ; ELF64: t5
95 %cmp = icmp eq i8 %a, 1 95 %cmp = icmp eq i8 %a, 1
96 ; ELF64: extsb 96 ; ELF64: extsb
97 ; ELF64: cmpwi 97 ; ELF64: cmpwi
103 103
104 if.end: ; preds = %if.then, %entry 104 if.end: ; preds = %if.then, %entry
105 ret void 105 ret void
106 } 106 }
107 107
108 define void @t6(i16 signext %a) uwtable ssp { 108 define void @t6(i16 signext %a) nounwind {
109 entry: 109 entry:
110 ; ELF64: t6 110 ; ELF64: t6
111 %cmp = icmp eq i16 %a, -1 111 %cmp = icmp eq i16 %a, -1
112 ; ELF64: extsh 112 ; ELF64: extsh
113 ; ELF64: cmpwi 113 ; ELF64: cmpwi
119 119
120 if.end: ; preds = %if.then, %entry 120 if.end: ; preds = %if.then, %entry
121 ret void 121 ret void
122 } 122 }
123 123
124 define void @t7(i16 zeroext %a) uwtable ssp { 124 define void @t7(i16 zeroext %a) nounwind {
125 entry: 125 entry:
126 ; ELF64: t7 126 ; ELF64: t7
127 %cmp = icmp eq i16 %a, 1 127 %cmp = icmp eq i16 %a, 1
128 ; ELF64: extsh 128 ; ELF64: extsh
129 ; ELF64: cmpwi 129 ; ELF64: cmpwi
135 135
136 if.end: ; preds = %if.then, %entry 136 if.end: ; preds = %if.then, %entry
137 ret void 137 ret void
138 } 138 }
139 139
140 define void @t8(i32 %a) uwtable ssp { 140 define void @t8(i32 %a) nounwind {
141 entry: 141 entry:
142 ; ELF64: t8 142 ; ELF64: t8
143 %cmp = icmp eq i32 %a, -1 143 %cmp = icmp eq i32 %a, -1
144 ; ELF64: cmpwi 144 ; ELF64: cmpwi
145 br i1 %cmp, label %if.then, label %if.end 145 br i1 %cmp, label %if.then, label %if.end
150 150
151 if.end: ; preds = %if.then, %entry 151 if.end: ; preds = %if.then, %entry
152 ret void 152 ret void
153 } 153 }
154 154
155 define void @t9(i32 %a) uwtable ssp { 155 define void @t9(i32 %a) nounwind {
156 entry: 156 entry:
157 ; ELF64: t9 157 ; ELF64: t9
158 %cmp = icmp eq i32 %a, 1 158 %cmp = icmp eq i32 %a, 1
159 ; ELF64: cmpwi 159 ; ELF64: cmpwi
160 br i1 %cmp, label %if.then, label %if.end 160 br i1 %cmp, label %if.then, label %if.end
165 165
166 if.end: ; preds = %if.then, %entry 166 if.end: ; preds = %if.then, %entry
167 ret void 167 ret void
168 } 168 }
169 169
170 define void @t10(i32 %a) uwtable ssp { 170 define void @t10(i32 %a) nounwind {
171 entry: 171 entry:
172 ; ELF64: t10 172 ; ELF64: t10
173 %cmp = icmp eq i32 %a, 384 173 %cmp = icmp eq i32 %a, 384
174 ; ELF64: cmpwi 174 ; ELF64: cmpwi
175 br i1 %cmp, label %if.then, label %if.end 175 br i1 %cmp, label %if.then, label %if.end
180 180
181 if.end: ; preds = %if.then, %entry 181 if.end: ; preds = %if.then, %entry
182 ret void 182 ret void
183 } 183 }
184 184
185 define void @t11(i32 %a) uwtable ssp { 185 define void @t11(i32 %a) nounwind {
186 entry: 186 entry:
187 ; ELF64: t11 187 ; ELF64: t11
188 %cmp = icmp eq i32 %a, 4096 188 %cmp = icmp eq i32 %a, 4096
189 ; ELF64: cmpwi 189 ; ELF64: cmpwi
190 br i1 %cmp, label %if.then, label %if.end 190 br i1 %cmp, label %if.then, label %if.end
195 195
196 if.end: ; preds = %if.then, %entry 196 if.end: ; preds = %if.then, %entry
197 ret void 197 ret void
198 } 198 }
199 199
200 define void @t12(i8 %a) uwtable ssp { 200 define void @t12(i8 %a) nounwind {
201 entry: 201 entry:
202 ; ELF64: t12 202 ; ELF64: t12
203 %cmp = icmp ugt i8 %a, -113 203 %cmp = icmp ugt i8 %a, -113
204 ; ELF64: rlwinm 204 ; ELF64: clrlwi
205 ; ELF64: cmplwi 205 ; ELF64: cmplwi
206 br i1 %cmp, label %if.then, label %if.end 206 br i1 %cmp, label %if.then, label %if.end
207 207
208 if.then: ; preds = %entry 208 if.then: ; preds = %entry
209 call void @foo() 209 call void @foo()
227 227
228 if.end: ; preds = %entry 228 if.end: ; preds = %entry
229 ret void 229 ret void
230 } 230 }
231 231
232 define void @t14(i64 %a) uwtable ssp { 232 define void @t14(i64 %a) nounwind {
233 entry: 233 entry:
234 ; ELF64: t14 234 ; ELF64: t14
235 %cmp = icmp eq i64 %a, -1 235 %cmp = icmp eq i64 %a, -1
236 ; ELF64: cmpdi 236 ; ELF64: cmpdi
237 br i1 %cmp, label %if.then, label %if.end 237 br i1 %cmp, label %if.then, label %if.end
242 242
243 if.end: ; preds = %if.then, %entry 243 if.end: ; preds = %if.then, %entry
244 ret void 244 ret void
245 } 245 }
246 246
247 define void @t15(i64 %a) uwtable ssp { 247 define void @t15(i64 %a) nounwind {
248 entry: 248 entry:
249 ; ELF64: t15 249 ; ELF64: t15
250 %cmp = icmp eq i64 %a, 1 250 %cmp = icmp eq i64 %a, 1
251 ; ELF64: cmpdi 251 ; ELF64: cmpdi
252 br i1 %cmp, label %if.then, label %if.end 252 br i1 %cmp, label %if.then, label %if.end
257 257
258 if.end: ; preds = %if.then, %entry 258 if.end: ; preds = %if.then, %entry
259 ret void 259 ret void
260 } 260 }
261 261
262 define void @t16(i64 %a) uwtable ssp { 262 define void @t16(i64 %a) nounwind {
263 entry: 263 entry:
264 ; ELF64: t16 264 ; ELF64: t16
265 %cmp = icmp eq i64 %a, 384 265 %cmp = icmp eq i64 %a, 384
266 ; ELF64: cmpdi 266 ; ELF64: cmpdi
267 br i1 %cmp, label %if.then, label %if.end 267 br i1 %cmp, label %if.then, label %if.end
272 272
273 if.end: ; preds = %if.then, %entry 273 if.end: ; preds = %if.then, %entry
274 ret void 274 ret void
275 } 275 }
276 276
277 define void @t17(i64 %a) uwtable ssp { 277 define void @t17(i64 %a) nounwind {
278 entry: 278 entry:
279 ; ELF64: t17 279 ; ELF64: t17
280 %cmp = icmp eq i64 %a, 32768 280 %cmp = icmp eq i64 %a, 32768
281 ; Extra operand so we don't match on cmpdi. 281 ; Extra operand so we don't match on cmpdi.
282 ; ELF64: cmpd {{[0-9]+}} 282 ; ELF64: cmpd {{[0-9]+}}