Dinesh Dwivedi | 657105e | 2014-06-17 14:34:19 +0000 | [diff] [blame] | 1 | ; RUN: opt -S -jump-threading < %s | FileCheck %s |
| 2 | |
| 3 | ; CHECK-LABEL: @f( |
| 4 | ; CHECK-LABEL: entry |
| 5 | ; CHECK: ret void |
| 6 | ; CHECK-NOT: for.cond1 |
| 7 | ; CHECK-NOT: for.body |
| 8 | |
| 9 | define void @f() { |
| 10 | entry: |
| 11 | ret void |
| 12 | |
| 13 | for.cond1: |
| 14 | %i.025 = phi i32 [ %inc, %for.body ], [ %inc, %for.body ], [ 1, %for.cond1 ] |
| 15 | %cmp = icmp slt i32 %i.025, 2 |
| 16 | br i1 %cmp, label %for.body, label %for.cond1 |
| 17 | |
| 18 | for.body: |
| 19 | %inc = add nsw i32 %i.025, 0 |
| 20 | %a = icmp ugt i32 %inc, 2 |
| 21 | br i1 %a, label %for.cond1, label %for.cond1 |
| 22 | } |