Changeset View
Changeset View
Standalone View
Standalone View
test/Transforms/SimplifyCFG/sink-common-code.ll
Show First 20 Lines • Show All 693 Lines • ▼ Show 20 Lines | |||||
if.end: | if.end: | ||||
ret i1 true | ret i1 true | ||||
} | } | ||||
; CHECK-LABEL: @test_pr30244 | ; CHECK-LABEL: @test_pr30244 | ||||
; CHECK: store | ; CHECK: store | ||||
; CHECK: store | ; CHECK: store | ||||
define i32 @test_pr30373a(i1 zeroext %flag, i32 %x, i32 %y) { | |||||
entry: | |||||
br i1 %flag, label %if.then, label %if.else | |||||
if.then: | |||||
%x0 = call i32 @foo(i32 %x, i32 0) nounwind readnone | |||||
%y0 = call i32 @foo(i32 %x, i32 1) nounwind readnone | |||||
%z0 = lshr i32 %y0, 8 | |||||
br label %if.end | |||||
if.else: | |||||
%x1 = call i32 @foo(i32 %y, i32 0) nounwind readnone | |||||
%y1 = call i32 @foo(i32 %y, i32 1) nounwind readnone | |||||
%z1 = lshr exact i32 %y1, 8 | |||||
br label %if.end | |||||
if.end: | |||||
%xx = phi i32 [ %x0, %if.then ], [ %x1, %if.else ] | |||||
%yy = phi i32 [ %z0, %if.then ], [ %z1, %if.else ] | |||||
%ret = add i32 %xx, %yy | |||||
ret i32 %ret | |||||
} | |||||
; CHECK-LABEL: test_pr30373a | |||||
; CHECK: lshr | |||||
; CHECK-NOT: exact | |||||
; CHECK: } | |||||
define i32 @test_pr30373b(i1 zeroext %flag, i32 %x, i32 %y) { | |||||
entry: | |||||
br i1 %flag, label %if.then, label %if.else | |||||
if.then: | |||||
%x0 = call i32 @foo(i32 %x, i32 0) nounwind readnone | |||||
%y0 = call i32 @foo(i32 %x, i32 1) nounwind readnone | |||||
%z0 = lshr exact i32 %y0, 8 | |||||
br label %if.end | |||||
if.else: | |||||
%x1 = call i32 @foo(i32 %y, i32 0) nounwind readnone | |||||
%y1 = call i32 @foo(i32 %y, i32 1) nounwind readnone | |||||
%z1 = lshr i32 %y1, 8 | |||||
br label %if.end | |||||
if.end: | |||||
%xx = phi i32 [ %x0, %if.then ], [ %x1, %if.else ] | |||||
%yy = phi i32 [ %z0, %if.then ], [ %z1, %if.else ] | |||||
%ret = add i32 %xx, %yy | |||||
ret i32 %ret | |||||
} | |||||
; CHECK-LABEL: test_pr30373b | |||||
; CHECK: lshr | |||||
; CHECK-NOT: exact | |||||
; CHECK: } | |||||
; CHECK: !0 = !{!1, !1, i64 0} | ; CHECK: !0 = !{!1, !1, i64 0} | ||||
; CHECK: !1 = !{!"float", !2} | ; CHECK: !1 = !{!"float", !2} | ||||
; CHECK: !2 = !{!"an example type tree"} | ; CHECK: !2 = !{!"an example type tree"} |