2011-11-26 16:24:25 +08:00
|
|
|
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
2005-09-24 02:43:57 +08:00
|
|
|
|
2008-03-18 11:45:45 +08:00
|
|
|
define void @test(i32* %P, i32* %Q, i1 %A, i1 %B) {
|
2011-11-26 16:24:25 +08:00
|
|
|
; CHECK: test
|
|
|
|
; CHECK: br i1
|
|
|
|
; CHECK-NOT: br i1
|
|
|
|
; CHECK: ret
|
|
|
|
; CHECK: ret
|
|
|
|
|
|
|
|
entry:
|
2008-03-18 11:45:45 +08:00
|
|
|
br i1 %A, label %a, label %b
|
2011-11-26 16:24:25 +08:00
|
|
|
a:
|
2008-03-18 11:45:45 +08:00
|
|
|
br i1 %B, label %b, label %c
|
2011-11-26 16:24:25 +08:00
|
|
|
b:
|
2008-03-18 11:45:45 +08:00
|
|
|
store i32 123, i32* %P
|
|
|
|
ret void
|
2011-11-26 16:24:25 +08:00
|
|
|
c:
|
2008-03-18 11:45:45 +08:00
|
|
|
ret void
|
2005-09-24 02:43:57 +08:00
|
|
|
}
|
2012-06-13 13:43:29 +08:00
|
|
|
|
|
|
|
; rdar://10554090
|
|
|
|
define zeroext i1 @test2(i64 %i0, i64 %i1) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
; CHECK: test2
|
|
|
|
; CHECK: br i1
|
|
|
|
%and.i.i = and i64 %i0, 281474976710655
|
|
|
|
%and.i11.i = and i64 %i1, 281474976710655
|
|
|
|
%or.cond = icmp eq i64 %and.i.i, %and.i11.i
|
|
|
|
br i1 %or.cond, label %c, label %a
|
|
|
|
|
|
|
|
a:
|
|
|
|
; CHECK: br
|
|
|
|
%shr.i4.i = lshr i64 %i0, 48
|
|
|
|
%and.i5.i = and i64 %shr.i4.i, 32767
|
|
|
|
%shr.i.i = lshr i64 %i1, 48
|
|
|
|
%and.i2.i = and i64 %shr.i.i, 32767
|
|
|
|
%cmp9.i = icmp ult i64 %and.i5.i, %and.i2.i
|
|
|
|
br i1 %cmp9.i, label %c, label %b
|
|
|
|
|
|
|
|
b:
|
|
|
|
; CHECK-NOT: br
|
|
|
|
%shr.i13.i9 = lshr i64 %i1, 48
|
|
|
|
%and.i14.i10 = and i64 %shr.i13.i9, 32767
|
|
|
|
%shr.i.i11 = lshr i64 %i0, 48
|
|
|
|
%and.i11.i12 = and i64 %shr.i.i11, 32767
|
|
|
|
%phitmp = icmp uge i64 %and.i14.i10, %and.i11.i12
|
|
|
|
br label %c
|
|
|
|
|
|
|
|
c:
|
|
|
|
%o2 = phi i1 [ false, %a ], [ %phitmp, %b ], [ false, %entry ]
|
|
|
|
ret i1 %o2
|
|
|
|
}
|
2012-06-24 18:15:42 +08:00
|
|
|
|
|
|
|
; PR13180
|
|
|
|
define void @pr13180(i8 %p) {
|
|
|
|
entry:
|
|
|
|
%tobool = icmp eq i8 %p, 0
|
|
|
|
br i1 %tobool, label %cond.false, label %cond.true
|
|
|
|
|
|
|
|
cond.true: ; preds = %entry
|
|
|
|
br label %cond.end
|
|
|
|
|
|
|
|
cond.false: ; preds = %entry
|
|
|
|
%phitmp = icmp eq i8 %p, 0
|
|
|
|
br label %cond.end
|
|
|
|
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
|
|
%cond = phi i1 [ undef, %cond.true ], [ %phitmp, %cond.false ]
|
|
|
|
unreachable
|
|
|
|
}
|