Dan Gohman | 1880092 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -instcombine -S | \ |
Dan Gohman | f9dd170 | 2007-08-15 13:36:28 +0000 | [diff] [blame] | 2 | ; RUN: grep icmp | count 1 |
Dan Gohman | 1880092 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 3 | ; RUN: opt < %s -instcombine -S | \ |
Chandler Carruth | a5a29f9 | 2012-07-02 12:47:22 +0000 | [diff] [blame] | 4 | ; RUN: grep "icmp ugt" | count 1 |
Tanya Lattner | aa6f5c9 | 2008-03-09 08:16:40 +0000 | [diff] [blame] | 5 | ; END. |
Reid Spencer | 91948d4 | 2007-04-14 20:13:02 +0000 | [diff] [blame] | 6 | |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 7 | target datalayout = "e-p:32:32" |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 8 | target triple = "i686-pc-linux-gnu" |
Tanya Lattner | 5640bd1 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 9 | @r = external global [17 x i32] ; <[17 x i32]*> [#uses=1] |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 10 | |
Tanya Lattner | 5640bd1 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 11 | define i1 @print_pgm_cond_true(i32 %tmp12.reload, i32* %tmp16.out) { |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 12 | newFuncRoot: |
| 13 | br label %cond_true |
| 14 | |
| 15 | bb27.exitStub: ; preds = %cond_true |
Tanya Lattner | 5640bd1 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 16 | store i32 %tmp16, i32* %tmp16.out |
| 17 | ret i1 true |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 18 | |
| 19 | cond_next23.exitStub: ; preds = %cond_true |
Tanya Lattner | 5640bd1 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 20 | store i32 %tmp16, i32* %tmp16.out |
| 21 | ret i1 false |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 22 | |
| 23 | cond_true: ; preds = %newFuncRoot |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 24 | %tmp15 = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1] |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 25 | %tmp16 = load i32, i32* %tmp15 ; <i32> [#uses=4] |
Tanya Lattner | 5640bd1 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 26 | %tmp18 = icmp slt i32 %tmp16, -31 ; <i1> [#uses=1] |
| 27 | %tmp21 = icmp sgt i32 %tmp16, 31 ; <i1> [#uses=1] |
| 28 | %bothcond = or i1 %tmp18, %tmp21 ; <i1> [#uses=1] |
| 29 | br i1 %bothcond, label %bb27.exitStub, label %cond_next23.exitStub |
Reid Spencer | 266e42b | 2006-12-23 06:05:41 +0000 | [diff] [blame] | 30 | } |
| 31 | |