Bill Wendling | a08bb49 | 2013-08-22 00:51:19 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s |
Nick Lewycky | 1c44ebc | 2008-02-20 06:48:22 +0000 | [diff] [blame] | 2 | ; PR2003 |
| 3 | |
Bill Wendling | a08bb49 | 2013-08-22 00:51:19 +0000 | [diff] [blame^] | 4 | ; CHECK: umax |
| 5 | |
Nick Lewycky | 1c44ebc | 2008-02-20 06:48:22 +0000 | [diff] [blame] | 6 | define i32 @foo(i32 %n) { |
| 7 | entry: |
| 8 | br label %header |
| 9 | header: |
| 10 | %i = phi i32 [ 100, %entry ], [ %i.inc, %next ] |
| 11 | %cond = icmp ult i32 %i, %n |
| 12 | br i1 %cond, label %next, label %return |
| 13 | next: |
| 14 | %i.inc = add i32 %i, 1 |
| 15 | br label %header |
| 16 | return: |
| 17 | ret i32 %i |
| 18 | } |
| 19 | |