X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FInstCombine%2Fsign-test-and-or.ll;h=aa23d933b09eb23d48d044921449ad0f84203f2d;hb=1377449177bf4df0aa5d5c0f2225a9e03c01e394;hp=3f2141d7a9f2c1a89f07936c8a7f1010e72a0333;hpb=d4242d8ab11b0da74867299cec7c2f6354c037dd;p=oota-llvm.git diff --git a/test/Transforms/InstCombine/sign-test-and-or.ll b/test/Transforms/InstCombine/sign-test-and-or.ll index 3f2141d7a9f..aa23d933b09 100644 --- a/test/Transforms/InstCombine/sign-test-and-or.ll +++ b/test/Transforms/InstCombine/sign-test-and-or.ll @@ -8,7 +8,7 @@ define void @test1(i32 %a, i32 %b) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: %1 = or i32 %a, %b ; CHECK-NEXT: %2 = icmp slt i32 %1, 0 ; CHECK-NEXT: br @@ -27,7 +27,7 @@ define void @test2(i32 %a, i32 %b) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %1 = and i32 %a, %b ; CHECK-NEXT: %2 = icmp sgt i32 %1, -1 ; CHECK-NEXT: br @@ -46,7 +46,7 @@ define void @test3(i32 %a, i32 %b) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %1 = and i32 %a, %b ; CHECK-NEXT: %2 = icmp slt i32 %1, 0 ; CHECK-NEXT: br @@ -65,7 +65,7 @@ define void @test4(i32 %a, i32 %b) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %1 = or i32 %a, %b ; CHECK-NEXT: %2 = icmp sgt i32 %1, -1 ; CHECK-NEXT: br @@ -85,7 +85,7 @@ define void @test5(i32 %a) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.then, label %if.end @@ -105,7 +105,7 @@ define void @test6(i32 %a) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.then, label %if.end @@ -125,7 +125,7 @@ define void @test7(i32 %a) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.end, label %if.the @@ -145,7 +145,7 @@ define void @test8(i32 %a) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.end, label %if.the @@ -157,3 +157,61 @@ if.then: if.end: ret void } + +define void @test9(i32 %a) nounwind { + %1 = and i32 %a, 1073741824 + %2 = icmp ne i32 %1, 0 + %3 = icmp sgt i32 %a, -1 + %or.cond = and i1 %2, %3 + br i1 %or.cond, label %if.then, label %if.end + +; CHECK-LABEL: @test9( +; CHECK-NEXT: %1 = and i32 %a, -1073741824 +; CHECK-NEXT: %2 = icmp eq i32 %1, 1073741824 +; CHECK-NEXT: br i1 %2, label %if.then, label %if.end + +if.then: + tail call void @foo() nounwind + ret void + +if.end: + ret void +} + +define void @test10(i32 %a) nounwind { + %1 = and i32 %a, 2 + %2 = icmp eq i32 %1, 0 + %3 = icmp ult i32 %a, 4 + %or.cond = and i1 %2, %3 + br i1 %or.cond, label %if.then, label %if.end + +; CHECK-LABEL: @test10( +; CHECK-NEXT: %1 = icmp ult i32 %a, 2 +; CHECK-NEXT: br i1 %1, label %if.then, label %if.end + +if.then: + tail call void @foo() nounwind + ret void + +if.end: + ret void +} + +define void @test11(i32 %a) nounwind { + %1 = and i32 %a, 2 + %2 = icmp ne i32 %1, 0 + %3 = icmp ugt i32 %a, 3 + %or.cond = or i1 %2, %3 + br i1 %or.cond, label %if.then, label %if.end + +; CHECK-LABEL: @test11( +; CHECK-NEXT: %1 = icmp ugt i32 %a, 1 +; CHECK-NEXT: br i1 %1, label %if.then, label %if.end + +if.then: + tail call void @foo() nounwind + ret void + +if.end: + ret void +}