diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-01-20 11:28:07 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-01-20 11:28:07 +0000 |
commit | 8942722cbc2f379184e57ed11c6093a38c4724dc (patch) | |
tree | 26c20c2b0d87c2567c1ec449736b39edfc02d901 | |
parent | 522d1f432f97f8712fe22b139c21e20ca3757dd7 (diff) | |
download | llvm-8942722cbc2f379184e57ed11c6093a38c4724dc.zip llvm-8942722cbc2f379184e57ed11c6093a38c4724dc.tar.gz llvm-8942722cbc2f379184e57ed11c6093a38c4724dc.tar.bz2 |
[InstCombine][SSE] Tests showing missed opportunities to handle packss/packus with undef arguments
llvm-svn: 292601
-rw-r--r-- | llvm/test/Transforms/InstCombine/x86-pack.ll | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/x86-pack.ll b/llvm/test/Transforms/InstCombine/x86-pack.ll index 88149b1..db54668 100644 --- a/llvm/test/Transforms/InstCombine/x86-pack.ll +++ b/llvm/test/Transforms/InstCombine/x86-pack.ll @@ -2,6 +2,82 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s ; +; UNDEF Elts +; + +define <8 x i16> @undef_packssdw_128() { +; CHECK-LABEL: @undef_packssdw_128( +; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.packssdw.128(<4 x i32> undef, <4 x i32> undef) +; CHECK-NEXT: ret <8 x i16> [[TMP1]] +; + %1 = call <8 x i16> @llvm.x86.sse2.packssdw.128(<4 x i32> undef, <4 x i32> undef) + ret <8 x i16> %1 +} + +define <8 x i16> @undef_packusdw_128() { +; CHECK-LABEL: @undef_packusdw_128( +; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse41.packusdw(<4 x i32> undef, <4 x i32> undef) +; CHECK-NEXT: ret <8 x i16> [[TMP1]] +; + %1 = call <8 x i16> @llvm.x86.sse41.packusdw(<4 x i32> undef, <4 x i32> undef) + ret <8 x i16> %1 +} + +define <16 x i8> @undef_packsswb_128() { +; CHECK-LABEL: @undef_packsswb_128( +; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i8> @llvm.x86.sse2.packsswb.128(<8 x i16> undef, <8 x i16> undef) +; CHECK-NEXT: ret <16 x i8> [[TMP1]] +; + %1 = call <16 x i8> @llvm.x86.sse2.packsswb.128(<8 x i16> undef, <8 x i16> undef) + ret <16 x i8> %1 +} + +define <16 x i8> @undef_packuswb_128() { +; CHECK-LABEL: @undef_packuswb_128( +; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16> undef, <8 x i16> undef) +; CHECK-NEXT: ret <16 x i8> [[TMP1]] +; + %1 = call <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16> undef, <8 x i16> undef) + ret <16 x i8> %1 +} + +define <16 x i16> @undef_packssdw_256() { +; CHECK-LABEL: @undef_packssdw_256( +; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.packssdw(<8 x i32> undef, <8 x i32> undef) +; CHECK-NEXT: ret <16 x i16> [[TMP1]] +; + %1 = call <16 x i16> @llvm.x86.avx2.packssdw(<8 x i32> undef, <8 x i32> undef) + ret <16 x i16> %1 +} + +define <16 x i16> @undef_packusdw_256() { +; CHECK-LABEL: @undef_packusdw_256( +; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32> undef, <8 x i32> undef) +; CHECK-NEXT: ret <16 x i16> [[TMP1]] +; + %1 = call <16 x i16> @llvm.x86.avx2.packusdw(<8 x i32> undef, <8 x i32> undef) + ret <16 x i16> %1 +} + +define <32 x i8> @undef_packsswb_256() { +; CHECK-LABEL: @undef_packsswb_256( +; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16> undef, <16 x i16> undef) +; CHECK-NEXT: ret <32 x i8> [[TMP1]] +; + %1 = call <32 x i8> @llvm.x86.avx2.packsswb(<16 x i16> undef, <16 x i16> undef) + ret <32 x i8> %1 +} + +define <32 x i8> @undef_packuswb_256() { +; CHECK-LABEL: @undef_packuswb_256( +; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> undef, <16 x i16> undef) +; CHECK-NEXT: ret <32 x i8> [[TMP1]] +; + %1 = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> undef, <16 x i16> undef) + ret <32 x i8> %1 +} + +; ; Demanded Elts ; |