|
9 | 9 | ; CHECK: irce: in function signed_var_imm_dec_sge: constrained Loop at depth 1 containing: %for.body<header>,%if.else,%for.inc<latch><exiting>
|
10 | 10 | ; CHECK: irce: in function signed_var_imm_dec_ne: constrained Loop at depth 1 containing: %for.body<header>,%if.else,%for.inc<latch><exiting>
|
11 | 11 | ; CHECK-NOT: irce: in function signed_var_imm_dec_eq: constrained Loop at depth 1 containing: %for.body<header>,%if.else,%for.inc<latch><exiting>
|
| 12 | +; CHECK-NOT: irce: in function test_dec_bound_with_smaller_start_than_bound: constrained Loop at depth 1 containing: %for.body<header>,%if.else,%for.dec<latch><exiting> |
| 13 | +; CHECK-NOT: irce: in function test_inc_bound_with_bigger_start_than_bound: constrained Loop at depth 1 containing: %for.body<header>,%if.else,%for.dec<latch><exiting> |
12 | 14 |
|
13 | 15 | ; CHECK-LABEL: test_inc_eq(
|
14 | 16 | ; CHECK: main.exit.selector:
|
@@ -352,3 +354,49 @@ for.inc: ; preds = %for.body, %if.else
|
352 | 354 | %cmp = icmp eq i32 %dec, %M
|
353 | 355 | br i1 %cmp, label %for.cond.cleanup, label %for.body
|
354 | 356 | }
|
| 357 | + |
| 358 | +; CHECK-LABEL: @test_dec_bound_with_smaller_start_than_bound( |
| 359 | +; CHECK-NOT: preloop.exit.selector: |
| 360 | +define void @test_dec_bound_with_smaller_start_than_bound(i64 %0) { |
| 361 | +entry: |
| 362 | + br label %for.body |
| 363 | + |
| 364 | +for.body: ; preds = %for.dec, %entry |
| 365 | + %iv = phi i64 [ %dec, %for.dec ], [ 0, %entry ] |
| 366 | + %1 = icmp slt i64 %iv, %0 |
| 367 | + br i1 %1, label %if.else, label %for.dec |
| 368 | + |
| 369 | +if.else: ; preds = %for.body |
| 370 | + br label %for.dec |
| 371 | + |
| 372 | +for.dec: ; preds = %if.else, %for.body |
| 373 | + %dec = sub nuw nsw i64 %iv, 1 |
| 374 | + %2 = icmp slt i64 %dec, 1 |
| 375 | + br i1 %2, label %exit, label %for.body |
| 376 | + |
| 377 | +exit: ; preds = %for.dec |
| 378 | + ret void |
| 379 | +} |
| 380 | + |
| 381 | +; CHECK-LABEL: @test_inc_bound_with_bigger_start_than_bound( |
| 382 | +; CHECK-NOT: main.exit.selector: |
| 383 | +define void @test_inc_bound_with_bigger_start_than_bound(i32 %0) { |
| 384 | +entry: |
| 385 | + br label %for.body |
| 386 | + |
| 387 | +for.body: ; preds = %for.inc, %entry |
| 388 | + %iv = phi i32 [ %inc, %for.inc ], [ 200, %entry ] |
| 389 | + %1 = icmp slt i32 %iv, %0 |
| 390 | + br i1 %1, label %if.else, label %for.inc |
| 391 | + |
| 392 | +if.else: ; preds = %for.body |
| 393 | + br label %for.inc |
| 394 | + |
| 395 | +for.inc: ; preds = %if.else, %for.body |
| 396 | + %inc = add nsw i32 %iv, 1 |
| 397 | + %2 = icmp sgt i32 %inc, 100 |
| 398 | + br i1 %2, label %exit, label %for.body |
| 399 | + |
| 400 | +exit: ; preds = %for.inc |
| 401 | + ret void |
| 402 | +} |
0 commit comments