blob: 784b3e4fe6875c739c9a2fdd3b1e40cbaf26d6c8 [file] [log] [blame]
Dan Gohman18800922009-09-11 18:01:28 +00001; RUN: opt < %s -instcombine -S | \
Dan Gohmanf9dd1702007-08-15 13:36:28 +00002; RUN: grep icmp | count 1
Dan Gohman18800922009-09-11 18:01:28 +00003; RUN: opt < %s -instcombine -S | \
Chandler Carrutha5a29f92012-07-02 12:47:22 +00004; RUN: grep "icmp ugt" | count 1
Tanya Lattneraa6f5c92008-03-09 08:16:40 +00005; END.
Reid Spencer91948d42007-04-14 20:13:02 +00006
Reid Spencer266e42b2006-12-23 06:05:41 +00007target datalayout = "e-p:32:32"
Reid Spencer266e42b2006-12-23 06:05:41 +00008target triple = "i686-pc-linux-gnu"
Tanya Lattner5640bd12008-03-01 09:15:35 +00009@r = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
Reid Spencer266e42b2006-12-23 06:05:41 +000010
Tanya Lattner5640bd12008-03-01 09:15:35 +000011define i1 @print_pgm_cond_true(i32 %tmp12.reload, i32* %tmp16.out) {
Reid Spencer266e42b2006-12-23 06:05:41 +000012newFuncRoot:
13 br label %cond_true
14
15bb27.exitStub: ; preds = %cond_true
Tanya Lattner5640bd12008-03-01 09:15:35 +000016 store i32 %tmp16, i32* %tmp16.out
17 ret i1 true
Reid Spencer266e42b2006-12-23 06:05:41 +000018
19cond_next23.exitStub: ; preds = %cond_true
Tanya Lattner5640bd12008-03-01 09:15:35 +000020 store i32 %tmp16, i32* %tmp16.out
21 ret i1 false
Reid Spencer266e42b2006-12-23 06:05:41 +000022
23cond_true: ; preds = %newFuncRoot
David Blaikie79e6c742015-02-27 19:29:02 +000024 %tmp15 = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000025 %tmp16 = load i32, i32* %tmp15 ; <i32> [#uses=4]
Tanya Lattner5640bd12008-03-01 09:15:35 +000026 %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 Spencer266e42b2006-12-23 06:05:41 +000030}
31