Bill Wendling | a08bb49 | 2013-08-22 00:51:19 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -indvars -adce -simplifycfg -S | FileCheck %s |
Nick Lewycky | b9819f3 | 2007-08-06 18:33:46 +0000 | [diff] [blame] | 2 | ; PR1598 |
| 3 | |
Bill Wendling | a08bb49 | 2013-08-22 00:51:19 +0000 | [diff] [blame^] | 4 | ; CHECK: icmp s |
| 5 | |
Nick Lewycky | b9819f3 | 2007-08-06 18:33:46 +0000 | [diff] [blame] | 6 | define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) { |
| 7 | entry: |
| 8 | %tmp3 = icmp eq i32 %a, %b ; <i1> [#uses=1] |
| 9 | br i1 %tmp3, label %return, label %bb |
| 10 | |
| 11 | bb: ; preds = %bb, %entry |
| 12 | %x_addr.0 = phi i32 [ %tmp6, %bb ], [ %x, %entry ] ; <i32> [#uses=1] |
| 13 | %tmp6 = add i32 %x_addr.0, 1 ; <i32> [#uses=3] |
| 14 | %tmp9 = icmp slt i32 %tmp6, %y ; <i1> [#uses=1] |
| 15 | br i1 %tmp9, label %bb, label %return |
| 16 | |
| 17 | return: ; preds = %bb, %entry |
| 18 | %x_addr.1 = phi i32 [ %x, %entry ], [ %tmp6, %bb ] ; <i32> [#uses=1] |
| 19 | ret i32 %x_addr.1 |
| 20 | } |