Index: test/Transforms/InstCombine/not-fcmp.ll =================================================================== --- test/Transforms/InstCombine/not-fcmp.ll +++ test/Transforms/InstCombine/not-fcmp.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S | grep "fcmp uge" +; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1570 define i1 @f(float %X, float %Y) { @@ -6,5 +6,8 @@ %tmp3 = fcmp olt float %X, %Y ; [#uses=1] %toBoolnot5 = xor i1 %tmp3, true ; [#uses=1] ret i1 %toBoolnot5 +; CHECK-LABEL: @f( +; CHECK-NEXT: entry: +; CHECK-NEXT: %toBoolnot5 = fcmp uge float %X, %Y +; CHECK-NEXT: ret i1 %toBoolnot5 } - Index: test/Transforms/InstCombine/not.ll =================================================================== --- test/Transforms/InstCombine/not.ll +++ test/Transforms/InstCombine/not.ll @@ -1,12 +1,14 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: opt < %s -instcombine -S | not grep xor +; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @test1(i32 %A) { %B = xor i32 %A, -1 ; [#uses=1] %C = xor i32 %B, -1 ; [#uses=1] ret i32 %C +; CHECK-LABEL: @test1( +; CHECK-NEXT: ret i32 %A } define i1 @test2(i32 %A, i32 %B) { @@ -14,6 +16,9 @@ %cond = icmp sle i32 %A, %B ; [#uses=1] %Ret = xor i1 %cond, true ; [#uses=1] ret i1 %Ret +; CHECK-LABEL: @test2( +; CHECK-NEXT: %Ret = icmp sgt i32 %A, %B +; CHECK-NEXT: ret i1 %Ret } ; Test that demorgans law can be instcombined @@ -23,6 +28,9 @@ %c = and i32 %a, %b ; [#uses=1] %d = xor i32 %c, -1 ; [#uses=1] ret i32 %d +; CHECK-LABEL: @test3( +; CHECK-NEXT: %c.demorgan = or i32 %A, %B +; CHECK-NEXT: ret i32 %c.demorgan } ; Test that demorgens law can work with constants @@ -31,6 +39,9 @@ %c = and i32 %a, 5 ; [#uses=1] %d = xor i32 %c, -1 ; [#uses=1] ret i32 %d +; CHECK-LABEL: @test4( +; CHECK-NEXT: %d1 = or i32 %A, -6 +; CHECK-NEXT: ret i32 %d1 } ; test the mirror of demorgans law... @@ -40,6 +51,9 @@ %c = or i32 %a, %b ; [#uses=1] %d = xor i32 %c, -1 ; [#uses=1] ret i32 %d +; CHECK-LABEL: @test5( +; CHECK-NEXT: %c.demorgan = and i32 %A, %B +; CHECK-NEXT: ret i32 %c.demorgan } ; PR2298 @@ -50,5 +64,9 @@ %tmp3 = icmp slt i32 %tmp1not, %tmp2not ; [#uses=1] %retval67 = zext i1 %tmp3 to i8 ; [#uses=1] ret i8 %retval67 +; CHECK-LABEL: @test6( +; CHECK-NEXT: entry: +; CHECK-NEXT: %tmp3 = icmp slt i32 %b, %a +; CHECK-NEXT: %retval67 = zext i1 %tmp3 to i8 +; CHECK-NEXT: ret i8 %retval67 } -