1 ; RUN: llvm-as < %s | llc -O3
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
5 target triple = "i386-pc-linux-gnu"
6 @g_3 = common global i8 0, align 1 ; <i8*> [#uses=2]
8 define signext i8 @safe_mul_func_int16_t_s_s(i32 %_si1, i8 signext %_si2) nounwind readnone {
10 %tobool = icmp eq i32 %_si1, 0 ; <i1> [#uses=1]
11 %cmp = icmp sgt i8 %_si2, 0 ; <i1> [#uses=2]
12 %or.cond = or i1 %cmp, %tobool ; <i1> [#uses=1]
13 br i1 %or.cond, label %lor.rhs, label %land.lhs.true3
15 land.lhs.true3: ; preds = %entry
16 %conv5 = sext i8 %_si2 to i32 ; <i32> [#uses=1]
17 %cmp7 = icmp slt i32 %conv5, %_si1 ; <i1> [#uses=1]
18 br i1 %cmp7, label %cond.end, label %lor.rhs
20 lor.rhs: ; preds = %land.lhs.true3, %entry
21 %cmp10.not = icmp slt i32 %_si1, 1 ; <i1> [#uses=1]
22 %or.cond23 = and i1 %cmp, %cmp10.not ; <i1> [#uses=1]
23 br i1 %or.cond23, label %lor.end, label %cond.false
25 lor.end: ; preds = %lor.rhs
26 %tobool19 = icmp ne i8 %_si2, 0 ; <i1> [#uses=2]
27 %lor.ext = zext i1 %tobool19 to i32 ; <i32> [#uses=1]
28 br i1 %tobool19, label %cond.end, label %cond.false
30 cond.false: ; preds = %lor.end, %lor.rhs
31 %conv21 = sext i8 %_si2 to i32 ; <i32> [#uses=1]
34 cond.end: ; preds = %cond.false, %lor.end, %land.lhs.true3
35 %cond = phi i32 [ %conv21, %cond.false ], [ 1, %land.lhs.true3 ], [ %lor.ext, %lor.end ] ; <i32> [#uses=1]
36 %conv22 = trunc i32 %cond to i8 ; <i8> [#uses=1]
40 define i32 @func_34(i8 signext %p_35) nounwind readonly {
42 %tobool = icmp eq i8 %p_35, 0 ; <i1> [#uses=1]
43 br i1 %tobool, label %lor.lhs.false, label %if.then
45 lor.lhs.false: ; preds = %entry
46 %tmp1 = load i8* @g_3 ; <i8> [#uses=1]
47 %tobool3 = icmp eq i8 %tmp1, 0 ; <i1> [#uses=1]
48 br i1 %tobool3, label %return, label %if.then
50 if.then: ; preds = %lor.lhs.false, %entry
51 %tmp4 = load i8* @g_3 ; <i8> [#uses=1]
52 %conv5 = sext i8 %tmp4 to i32 ; <i32> [#uses=1]
55 return: ; preds = %lor.lhs.false
59 define void @foo(i32 %p_5) noreturn nounwind {
61 %cmp = icmp sgt i32 %p_5, 0 ; <i1> [#uses=2]
62 %call = tail call i32 @safe() nounwind ; <i32> [#uses=1]
63 %conv1 = trunc i32 %call to i8 ; <i8> [#uses=3]
64 %tobool.i = xor i1 %cmp, true ; <i1> [#uses=3]
65 %cmp.i = icmp sgt i8 %conv1, 0 ; <i1> [#uses=3]
66 %or.cond.i = or i1 %cmp.i, %tobool.i ; <i1> [#uses=1]
67 br i1 %or.cond.i, label %lor.rhs.i, label %land.lhs.true3.i
69 land.lhs.true3.i: ; preds = %entry
70 %xor = zext i1 %cmp to i32 ; <i32> [#uses=1]
71 %conv5.i = sext i8 %conv1 to i32 ; <i32> [#uses=1]
72 %cmp7.i = icmp slt i32 %conv5.i, %xor ; <i1> [#uses=1]
73 %cmp7.i.not = xor i1 %cmp7.i, true ; <i1> [#uses=1]
74 %or.cond23.i = and i1 %cmp.i, %tobool.i ; <i1> [#uses=1]
75 %or.cond = and i1 %cmp7.i.not, %or.cond23.i ; <i1> [#uses=1]
76 br i1 %or.cond, label %lor.end.i, label %for.inc
78 lor.rhs.i: ; preds = %entry
79 %or.cond23.i.old = and i1 %cmp.i, %tobool.i ; <i1> [#uses=1]
80 br i1 %or.cond23.i.old, label %lor.end.i, label %for.inc
82 lor.end.i: ; preds = %lor.rhs.i, %land.lhs.true3.i
83 %tobool19.i = icmp eq i8 %conv1, 0 ; <i1> [#uses=0]
86 for.inc: ; preds = %for.inc, %lor.end.i, %lor.rhs.i, %land.lhs.true3.i