Hal Finkel | b1fd3cd | 2013-05-15 21:37:41 +0000 | [diff] [blame] | 1 | target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64" |
| 2 | target triple = "powerpc64-unknown-linux-gnu" |
| 3 | ; RUN: llc < %s -march=ppc64 | FileCheck %s |
| 4 | |
| 5 | ; CHECK: test_pos1_ir_ne |
| 6 | ; CHECK: bdnz |
| 7 | ; a < b |
| 8 | define void @test_pos1_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 9 | entry: |
| 10 | %cmp3 = icmp slt i32 32623, %b |
| 11 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 12 | |
| 13 | for.body.lr.ph: ; preds = %entry |
| 14 | br label %for.body |
| 15 | |
| 16 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 17 | %i.04 = phi i32 [ 32623, %for.body.lr.ph ], [ %inc, %for.body ] |
| 18 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 19 | %0 = load i8* %arrayidx, align 1 |
| 20 | %conv = zext i8 %0 to i32 |
| 21 | %add = add nsw i32 %conv, 1 |
| 22 | %conv1 = trunc i32 %add to i8 |
| 23 | store i8 %conv1, i8* %arrayidx, align 1 |
| 24 | %inc = add nsw i32 %i.04, 1 |
| 25 | %cmp = icmp ne i32 %inc, %b |
| 26 | br i1 %cmp, label %for.body, label %for.end |
| 27 | |
| 28 | for.end: ; preds = %for.body, %entry |
| 29 | ret void |
| 30 | } |
| 31 | |
| 32 | |
| 33 | |
| 34 | ; CHECK: test_pos2_ir_ne |
| 35 | ; FIXME: Support this loop! |
| 36 | ; CHECK-NOT: bdnz |
| 37 | ; a < b |
| 38 | define void @test_pos2_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 39 | entry: |
| 40 | %cmp3 = icmp slt i32 29554, %b |
| 41 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 42 | |
| 43 | for.body.lr.ph: ; preds = %entry |
| 44 | br label %for.body |
| 45 | |
| 46 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 47 | %i.04 = phi i32 [ 29554, %for.body.lr.ph ], [ %inc, %for.body ] |
| 48 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 49 | %0 = load i8* %arrayidx, align 1 |
| 50 | %conv = zext i8 %0 to i32 |
| 51 | %add = add nsw i32 %conv, 1 |
| 52 | %conv1 = trunc i32 %add to i8 |
| 53 | store i8 %conv1, i8* %arrayidx, align 1 |
| 54 | %inc = add nsw i32 %i.04, 2 |
| 55 | %cmp = icmp ne i32 %inc, %b |
| 56 | br i1 %cmp, label %for.body, label %for.end |
| 57 | |
| 58 | for.end: ; preds = %for.body, %entry |
| 59 | ret void |
| 60 | } |
| 61 | |
| 62 | |
| 63 | |
| 64 | ; CHECK: test_pos4_ir_ne |
| 65 | ; FIXME: Support this loop! |
| 66 | ; CHECK-NOT: bdnz |
| 67 | ; a < b |
| 68 | define void @test_pos4_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 69 | entry: |
| 70 | %cmp3 = icmp slt i32 15692, %b |
| 71 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 72 | |
| 73 | for.body.lr.ph: ; preds = %entry |
| 74 | br label %for.body |
| 75 | |
| 76 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 77 | %i.04 = phi i32 [ 15692, %for.body.lr.ph ], [ %inc, %for.body ] |
| 78 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 79 | %0 = load i8* %arrayidx, align 1 |
| 80 | %conv = zext i8 %0 to i32 |
| 81 | %add = add nsw i32 %conv, 1 |
| 82 | %conv1 = trunc i32 %add to i8 |
| 83 | store i8 %conv1, i8* %arrayidx, align 1 |
| 84 | %inc = add nsw i32 %i.04, 4 |
| 85 | %cmp = icmp ne i32 %inc, %b |
| 86 | br i1 %cmp, label %for.body, label %for.end |
| 87 | |
| 88 | for.end: ; preds = %for.body, %entry |
| 89 | ret void |
| 90 | } |
| 91 | |
| 92 | |
| 93 | |
| 94 | ; CHECK: test_pos8_ir_ne |
| 95 | ; FIXME: Support this loop! |
| 96 | ; CHECK-NOT: bdnz |
| 97 | ; a < b |
| 98 | define void @test_pos8_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 99 | entry: |
| 100 | %cmp3 = icmp slt i32 10449, %b |
| 101 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 102 | |
| 103 | for.body.lr.ph: ; preds = %entry |
| 104 | br label %for.body |
| 105 | |
| 106 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 107 | %i.04 = phi i32 [ 10449, %for.body.lr.ph ], [ %inc, %for.body ] |
| 108 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 109 | %0 = load i8* %arrayidx, align 1 |
| 110 | %conv = zext i8 %0 to i32 |
| 111 | %add = add nsw i32 %conv, 1 |
| 112 | %conv1 = trunc i32 %add to i8 |
| 113 | store i8 %conv1, i8* %arrayidx, align 1 |
| 114 | %inc = add nsw i32 %i.04, 8 |
| 115 | %cmp = icmp ne i32 %inc, %b |
| 116 | br i1 %cmp, label %for.body, label %for.end |
| 117 | |
| 118 | for.end: ; preds = %for.body, %entry |
| 119 | ret void |
| 120 | } |
| 121 | |
| 122 | |
| 123 | |
| 124 | ; CHECK: test_pos16_ir_ne |
| 125 | ; FIXME: Support this loop! |
| 126 | ; CHECK-NOT: bdnz |
| 127 | ; a < b |
| 128 | define void @test_pos16_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 129 | entry: |
| 130 | %cmp3 = icmp slt i32 32087, %b |
| 131 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 132 | |
| 133 | for.body.lr.ph: ; preds = %entry |
| 134 | br label %for.body |
| 135 | |
| 136 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 137 | %i.04 = phi i32 [ 32087, %for.body.lr.ph ], [ %inc, %for.body ] |
| 138 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 139 | %0 = load i8* %arrayidx, align 1 |
| 140 | %conv = zext i8 %0 to i32 |
| 141 | %add = add nsw i32 %conv, 1 |
| 142 | %conv1 = trunc i32 %add to i8 |
| 143 | store i8 %conv1, i8* %arrayidx, align 1 |
| 144 | %inc = add nsw i32 %i.04, 16 |
| 145 | %cmp = icmp ne i32 %inc, %b |
| 146 | br i1 %cmp, label %for.body, label %for.end |
| 147 | |
| 148 | for.end: ; preds = %for.body, %entry |
| 149 | ret void |
| 150 | } |
| 151 | |
| 152 | |
| 153 | |
| 154 | ; CHECK: test_pos1_ri_ne |
| 155 | ; CHECK: bdnz |
| 156 | ; a < b |
| 157 | define void @test_pos1_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 158 | entry: |
| 159 | %cmp3 = icmp slt i32 %a, 3472 |
| 160 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 161 | |
| 162 | for.body.lr.ph: ; preds = %entry |
| 163 | br label %for.body |
| 164 | |
| 165 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 166 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 167 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 168 | %0 = load i8* %arrayidx, align 1 |
| 169 | %conv = zext i8 %0 to i32 |
| 170 | %add = add nsw i32 %conv, 1 |
| 171 | %conv1 = trunc i32 %add to i8 |
| 172 | store i8 %conv1, i8* %arrayidx, align 1 |
| 173 | %inc = add nsw i32 %i.04, 1 |
| 174 | %cmp = icmp ne i32 %inc, 3472 |
| 175 | br i1 %cmp, label %for.body, label %for.end |
| 176 | |
| 177 | for.end: ; preds = %for.body, %entry |
| 178 | ret void |
| 179 | } |
| 180 | |
| 181 | |
| 182 | |
| 183 | ; CHECK: test_pos2_ri_ne |
| 184 | ; FIXME: Support this loop! |
| 185 | ; CHECK-NOT: bdnz |
| 186 | ; a < b |
| 187 | define void @test_pos2_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 188 | entry: |
| 189 | %cmp3 = icmp slt i32 %a, 8730 |
| 190 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 191 | |
| 192 | for.body.lr.ph: ; preds = %entry |
| 193 | br label %for.body |
| 194 | |
| 195 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 196 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 197 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 198 | %0 = load i8* %arrayidx, align 1 |
| 199 | %conv = zext i8 %0 to i32 |
| 200 | %add = add nsw i32 %conv, 1 |
| 201 | %conv1 = trunc i32 %add to i8 |
| 202 | store i8 %conv1, i8* %arrayidx, align 1 |
| 203 | %inc = add nsw i32 %i.04, 2 |
| 204 | %cmp = icmp ne i32 %inc, 8730 |
| 205 | br i1 %cmp, label %for.body, label %for.end |
| 206 | |
| 207 | for.end: ; preds = %for.body, %entry |
| 208 | ret void |
| 209 | } |
| 210 | |
| 211 | |
| 212 | |
| 213 | ; CHECK: test_pos4_ri_ne |
| 214 | ; FIXME: Support this loop! |
| 215 | ; CHECK-NOT: bdnz |
| 216 | ; a < b |
| 217 | define void @test_pos4_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 218 | entry: |
| 219 | %cmp3 = icmp slt i32 %a, 1493 |
| 220 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 221 | |
| 222 | for.body.lr.ph: ; preds = %entry |
| 223 | br label %for.body |
| 224 | |
| 225 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 226 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 227 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 228 | %0 = load i8* %arrayidx, align 1 |
| 229 | %conv = zext i8 %0 to i32 |
| 230 | %add = add nsw i32 %conv, 1 |
| 231 | %conv1 = trunc i32 %add to i8 |
| 232 | store i8 %conv1, i8* %arrayidx, align 1 |
| 233 | %inc = add nsw i32 %i.04, 4 |
| 234 | %cmp = icmp ne i32 %inc, 1493 |
| 235 | br i1 %cmp, label %for.body, label %for.end |
| 236 | |
| 237 | for.end: ; preds = %for.body, %entry |
| 238 | ret void |
| 239 | } |
| 240 | |
| 241 | |
| 242 | |
| 243 | ; CHECK: test_pos8_ri_ne |
| 244 | ; FIXME: Support this loop! |
| 245 | ; CHECK-NOT: bdnz |
| 246 | ; a < b |
| 247 | define void @test_pos8_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 248 | entry: |
| 249 | %cmp3 = icmp slt i32 %a, 1706 |
| 250 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 251 | |
| 252 | for.body.lr.ph: ; preds = %entry |
| 253 | br label %for.body |
| 254 | |
| 255 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 256 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 257 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 258 | %0 = load i8* %arrayidx, align 1 |
| 259 | %conv = zext i8 %0 to i32 |
| 260 | %add = add nsw i32 %conv, 1 |
| 261 | %conv1 = trunc i32 %add to i8 |
| 262 | store i8 %conv1, i8* %arrayidx, align 1 |
| 263 | %inc = add nsw i32 %i.04, 8 |
| 264 | %cmp = icmp ne i32 %inc, 1706 |
| 265 | br i1 %cmp, label %for.body, label %for.end |
| 266 | |
| 267 | for.end: ; preds = %for.body, %entry |
| 268 | ret void |
| 269 | } |
| 270 | |
| 271 | |
| 272 | |
| 273 | ; CHECK: test_pos16_ri_ne |
| 274 | ; FIXME: Support this loop! |
| 275 | ; CHECK-NOT: bdnz |
| 276 | ; a < b |
| 277 | define void @test_pos16_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 278 | entry: |
| 279 | %cmp3 = icmp slt i32 %a, 1886 |
| 280 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 281 | |
| 282 | for.body.lr.ph: ; preds = %entry |
| 283 | br label %for.body |
| 284 | |
| 285 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 286 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 287 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 288 | %0 = load i8* %arrayidx, align 1 |
| 289 | %conv = zext i8 %0 to i32 |
| 290 | %add = add nsw i32 %conv, 1 |
| 291 | %conv1 = trunc i32 %add to i8 |
| 292 | store i8 %conv1, i8* %arrayidx, align 1 |
| 293 | %inc = add nsw i32 %i.04, 16 |
| 294 | %cmp = icmp ne i32 %inc, 1886 |
| 295 | br i1 %cmp, label %for.body, label %for.end |
| 296 | |
| 297 | for.end: ; preds = %for.body, %entry |
| 298 | ret void |
| 299 | } |
| 300 | |
| 301 | |
| 302 | |
| 303 | ; CHECK: test_pos1_rr_ne |
| 304 | ; CHECK: bdnz |
| 305 | ; a < b |
| 306 | define void @test_pos1_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 307 | entry: |
| 308 | %cmp3 = icmp slt i32 %a, %b |
| 309 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 310 | |
| 311 | for.body.lr.ph: ; preds = %entry |
| 312 | br label %for.body |
| 313 | |
| 314 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 315 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 316 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 317 | %0 = load i8* %arrayidx, align 1 |
| 318 | %conv = zext i8 %0 to i32 |
| 319 | %add = add nsw i32 %conv, 1 |
| 320 | %conv1 = trunc i32 %add to i8 |
| 321 | store i8 %conv1, i8* %arrayidx, align 1 |
| 322 | %inc = add nsw i32 %i.04, 1 |
| 323 | %cmp = icmp ne i32 %inc, %b |
| 324 | br i1 %cmp, label %for.body, label %for.end |
| 325 | |
| 326 | for.end: ; preds = %for.body, %entry |
| 327 | ret void |
| 328 | } |
| 329 | |
| 330 | |
| 331 | |
| 332 | ; CHECK: test_pos2_rr_ne |
| 333 | ; FIXME: Support this loop! |
| 334 | ; CHECK-NOT: bdnz |
| 335 | ; a < b |
| 336 | define void @test_pos2_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 337 | entry: |
| 338 | %cmp3 = icmp slt i32 %a, %b |
| 339 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 340 | |
| 341 | for.body.lr.ph: ; preds = %entry |
| 342 | br label %for.body |
| 343 | |
| 344 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 345 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 346 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 347 | %0 = load i8* %arrayidx, align 1 |
| 348 | %conv = zext i8 %0 to i32 |
| 349 | %add = add nsw i32 %conv, 1 |
| 350 | %conv1 = trunc i32 %add to i8 |
| 351 | store i8 %conv1, i8* %arrayidx, align 1 |
| 352 | %inc = add nsw i32 %i.04, 2 |
| 353 | %cmp = icmp ne i32 %inc, %b |
| 354 | br i1 %cmp, label %for.body, label %for.end |
| 355 | |
| 356 | for.end: ; preds = %for.body, %entry |
| 357 | ret void |
| 358 | } |
| 359 | |
| 360 | |
| 361 | |
| 362 | ; CHECK: test_pos4_rr_ne |
| 363 | ; FIXME: Support this loop! |
| 364 | ; CHECK-NOT: bdnz |
| 365 | ; a < b |
| 366 | define void @test_pos4_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 367 | entry: |
| 368 | %cmp3 = icmp slt i32 %a, %b |
| 369 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 370 | |
| 371 | for.body.lr.ph: ; preds = %entry |
| 372 | br label %for.body |
| 373 | |
| 374 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 375 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 376 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 377 | %0 = load i8* %arrayidx, align 1 |
| 378 | %conv = zext i8 %0 to i32 |
| 379 | %add = add nsw i32 %conv, 1 |
| 380 | %conv1 = trunc i32 %add to i8 |
| 381 | store i8 %conv1, i8* %arrayidx, align 1 |
| 382 | %inc = add nsw i32 %i.04, 4 |
| 383 | %cmp = icmp ne i32 %inc, %b |
| 384 | br i1 %cmp, label %for.body, label %for.end |
| 385 | |
| 386 | for.end: ; preds = %for.body, %entry |
| 387 | ret void |
| 388 | } |
| 389 | |
| 390 | |
| 391 | |
| 392 | ; CHECK: test_pos8_rr_ne |
| 393 | ; FIXME: Support this loop! |
| 394 | ; CHECK-NOT: bdnz |
| 395 | ; a < b |
| 396 | define void @test_pos8_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 397 | entry: |
| 398 | %cmp3 = icmp slt i32 %a, %b |
| 399 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 400 | |
| 401 | for.body.lr.ph: ; preds = %entry |
| 402 | br label %for.body |
| 403 | |
| 404 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 405 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 406 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 407 | %0 = load i8* %arrayidx, align 1 |
| 408 | %conv = zext i8 %0 to i32 |
| 409 | %add = add nsw i32 %conv, 1 |
| 410 | %conv1 = trunc i32 %add to i8 |
| 411 | store i8 %conv1, i8* %arrayidx, align 1 |
| 412 | %inc = add nsw i32 %i.04, 8 |
| 413 | %cmp = icmp ne i32 %inc, %b |
| 414 | br i1 %cmp, label %for.body, label %for.end |
| 415 | |
| 416 | for.end: ; preds = %for.body, %entry |
| 417 | ret void |
| 418 | } |
| 419 | |
| 420 | |
| 421 | |
| 422 | ; CHECK: test_pos16_rr_ne |
| 423 | ; FIXME: Support this loop! |
| 424 | ; CHECK-NOT: bdnz |
| 425 | ; a < b |
| 426 | define void @test_pos16_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind { |
| 427 | entry: |
| 428 | %cmp3 = icmp slt i32 %a, %b |
| 429 | br i1 %cmp3, label %for.body.lr.ph, label %for.end |
| 430 | |
| 431 | for.body.lr.ph: ; preds = %entry |
| 432 | br label %for.body |
| 433 | |
| 434 | for.body: ; preds = %for.body.lr.ph, %for.body |
| 435 | %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ] |
| 436 | %arrayidx = getelementptr inbounds i8* %p, i32 %i.04 |
| 437 | %0 = load i8* %arrayidx, align 1 |
| 438 | %conv = zext i8 %0 to i32 |
| 439 | %add = add nsw i32 %conv, 1 |
| 440 | %conv1 = trunc i32 %add to i8 |
| 441 | store i8 %conv1, i8* %arrayidx, align 1 |
| 442 | %inc = add nsw i32 %i.04, 16 |
| 443 | %cmp = icmp ne i32 %inc, %b |
| 444 | br i1 %cmp, label %for.body, label %for.end |
| 445 | |
| 446 | for.end: ; preds = %for.body, %entry |
| 447 | ret void |
| 448 | } |
| 449 | |