diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-07-03 14:34:39 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-07-03 14:34:39 +0000 |
commit | cbaac41856334fbe0d87b8d7afac4a3c07e4e84b (patch) | |
tree | 3bfe7a23f648654cef66bc262986bc47e53498ab /llvm/test/Transforms | |
parent | 598bdb6bfef2d316baf7cf2d2f77905f99031a8d (diff) | |
download | bcm5719-llvm-cbaac41856334fbe0d87b8d7afac4a3c07e4e84b.tar.gz bcm5719-llvm-cbaac41856334fbe0d87b8d7afac4a3c07e4e84b.zip |
[InstCombine] enable vector select of bools -> logic folds
llvm-svn: 274465
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/InstCombine/select.ll | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/llvm/test/Transforms/InstCombine/select.ll b/llvm/test/Transforms/InstCombine/select.ll index 180fe03c327..e0e7bfccff9 100644 --- a/llvm/test/Transforms/InstCombine/select.ll +++ b/llvm/test/Transforms/InstCombine/select.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1822 @@ -64,7 +65,7 @@ define i1 @test7(i1 %C, i1 %X) { define <2 x i1> @test7vec(<2 x i1> %C, <2 x i1> %X) { ; CHECK-LABEL: @test7vec( -; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %C, <2 x i1> <i1 true, i1 true>, <2 x i1> %X +; CHECK-NEXT: [[R:%.*]] = or <2 x i1> %C, %X ; CHECK-NEXT: ret <2 x i1> [[R]] ; %R = select <2 x i1> %C, <2 x i1> <i1 true, i1 true>, <2 x i1> %X @@ -82,7 +83,7 @@ define i1 @test8(i1 %C, i1 %X) { define <2 x i1> @test8vec(<2 x i1> %C, <2 x i1> %X) { ; CHECK-LABEL: @test8vec( -; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %C, <2 x i1> %X, <2 x i1> zeroinitializer +; CHECK-NEXT: [[R:%.*]] = and <2 x i1> %C, %X ; CHECK-NEXT: ret <2 x i1> [[R]] ; %R = select <2 x i1> %C, <2 x i1> %X, <2 x i1> <i1 false, i1 false> @@ -101,7 +102,8 @@ define i1 @test9(i1 %C, i1 %X) { define <2 x i1> @test9vec(<2 x i1> %C, <2 x i1> %X) { ; CHECK-LABEL: @test9vec( -; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %C, <2 x i1> zeroinitializer, <2 x i1> %X +; CHECK-NEXT: [[NOT_C:%.*]] = xor <2 x i1> %C, <i1 true, i1 true> +; CHECK-NEXT: [[R:%.*]] = and <2 x i1> [[NOT_C]], %X ; CHECK-NEXT: ret <2 x i1> [[R]] ; %R = select <2 x i1> %C, <2 x i1> <i1 false, i1 false>, <2 x i1> %X @@ -120,7 +122,8 @@ define i1 @test10(i1 %C, i1 %X) { define <2 x i1> @test10vec(<2 x i1> %C, <2 x i1> %X) { ; CHECK-LABEL: @test10vec( -; CHECK-NEXT: [[R:%.*]] = select <2 x i1> %C, <2 x i1> %X, <2 x i1> <i1 true, i1 true> +; CHECK-NEXT: [[NOT_C:%.*]] = xor <2 x i1> %C, <i1 true, i1 true> +; CHECK-NEXT: [[R:%.*]] = or <2 x i1> [[NOT_C]], %X ; CHECK-NEXT: ret <2 x i1> [[R]] ; %R = select <2 x i1> %C, <2 x i1> %X, <2 x i1> <i1 true, i1 true> @@ -138,7 +141,7 @@ define i1 @test23(i1 %a, i1 %b) { define <2 x i1> @test23vec(<2 x i1> %a, <2 x i1> %b) { ; CHECK-LABEL: @test23vec( -; CHECK-NEXT: [[C:%.*]] = select <2 x i1> %a, <2 x i1> %b, <2 x i1> %a +; CHECK-NEXT: [[C:%.*]] = and <2 x i1> %a, %b ; CHECK-NEXT: ret <2 x i1> [[C]] ; %c = select <2 x i1> %a, <2 x i1> %b, <2 x i1> %a @@ -156,7 +159,7 @@ define i1 @test24(i1 %a, i1 %b) { define <2 x i1> @test24vec(<2 x i1> %a, <2 x i1> %b) { ; CHECK-LABEL: @test24vec( -; CHECK-NEXT: [[C:%.*]] = select <2 x i1> %a, <2 x i1> %a, <2 x i1> %b +; CHECK-NEXT: [[C:%.*]] = or <2 x i1> %a, %b ; CHECK-NEXT: ret <2 x i1> [[C]] ; %c = select <2 x i1> %a, <2 x i1> %a, <2 x i1> %b @@ -177,7 +180,7 @@ define i1 @test62(i1 %A, i1 %B) { define <2 x i1> @test62vec(<2 x i1> %A, <2 x i1> %B) { ; CHECK-LABEL: @test62vec( ; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> %A, <i1 true, i1 true> -; CHECK-NEXT: [[C:%.*]] = select <2 x i1> %A, <2 x i1> [[NOT]], <2 x i1> %B +; CHECK-NEXT: [[C:%.*]] = and <2 x i1> [[NOT]], %B ; CHECK-NEXT: ret <2 x i1> [[C]] ; %not = xor <2 x i1> %A, <i1 true, i1 true> @@ -199,7 +202,7 @@ define i1 @test63(i1 %A, i1 %B) { define <2 x i1> @test63vec(<2 x i1> %A, <2 x i1> %B) { ; CHECK-LABEL: @test63vec( ; CHECK-NEXT: [[NOT:%.*]] = xor <2 x i1> %A, <i1 true, i1 true> -; CHECK-NEXT: [[C:%.*]] = select <2 x i1> %A, <2 x i1> %B, <2 x i1> [[NOT]] +; CHECK-NEXT: [[C:%.*]] = or <2 x i1> %B, [[NOT]] ; CHECK-NEXT: ret <2 x i1> [[C]] ; %not = xor <2 x i1> %A, <i1 true, i1 true> |