brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.6 KiB · 6de8127 Raw
178 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -mtriple=x86_64-unknown-unknown -S | FileCheck %s3 4;5; UNDEF Elts6;7 8define <8 x i16> @undef_pmaddubsw_128(<16 x i8> %a0) {9; CHECK-LABEL: @undef_pmaddubsw_128(10; CHECK-NEXT:    ret <8 x i16> zeroinitializer11;12  %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %a0, <16 x i8> undef)13  ret <8 x i16> %114}15 16define <8 x i16> @undef_pmaddubsw_128_commute(<16 x i8> %a0) {17; CHECK-LABEL: @undef_pmaddubsw_128_commute(18; CHECK-NEXT:    ret <8 x i16> zeroinitializer19;20  %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> undef, <16 x i8> %a0)21  ret <8 x i16> %122}23 24define <16 x i16> @undef_pmaddubsw_256(<32 x i8> %a0) {25; CHECK-LABEL: @undef_pmaddubsw_256(26; CHECK-NEXT:    ret <16 x i16> zeroinitializer27;28  %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %a0, <32 x i8> undef)29  ret <16 x i16> %130}31 32define <16 x i16> @undef_pmaddubsw_256_commute(<32 x i8> %a0) {33; CHECK-LABEL: @undef_pmaddubsw_256_commute(34; CHECK-NEXT:    ret <16 x i16> zeroinitializer35;36  %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> undef, <32 x i8> %a0)37  ret <16 x i16> %138}39 40define <32 x i16> @undef_pmaddubsw_512(<64 x i8> %a0) {41; CHECK-LABEL: @undef_pmaddubsw_512(42; CHECK-NEXT:    ret <32 x i16> zeroinitializer43;44  %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> %a0, <64 x i8> undef)45  ret <32 x i16> %146}47 48define <32 x i16> @undef_pmaddubsw_512_commute(<64 x i8> %a0) {49; CHECK-LABEL: @undef_pmaddubsw_512_commute(50; CHECK-NEXT:    ret <32 x i16> zeroinitializer51;52  %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> undef, <64 x i8> %a0)53  ret <32 x i16> %154}55 56;57; Zero Elts58;59 60define <8 x i16> @zero_pmaddubsw_128(<16 x i8> %a0) {61; CHECK-LABEL: @zero_pmaddubsw_128(62; CHECK-NEXT:    ret <8 x i16> zeroinitializer63;64  %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %a0, <16 x i8> zeroinitializer)65  ret <8 x i16> %166}67 68define <8 x i16> @zero_pmaddubsw_128_commute(<16 x i8> %a0) {69; CHECK-LABEL: @zero_pmaddubsw_128_commute(70; CHECK-NEXT:    ret <8 x i16> zeroinitializer71;72  %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> zeroinitializer, <16 x i8> %a0)73  ret <8 x i16> %174}75 76define <16 x i16> @zero_pmaddubsw_256(<32 x i8>%a0) {77; CHECK-LABEL: @zero_pmaddubsw_256(78; CHECK-NEXT:    ret <16 x i16> zeroinitializer79;80  %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %a0, <32 x i8> zeroinitializer)81  ret <16 x i16> %182}83 84define <16 x i16> @zero_pmaddubsw_256_commute(<32 x i8> %a0) {85; CHECK-LABEL: @zero_pmaddubsw_256_commute(86; CHECK-NEXT:    ret <16 x i16> zeroinitializer87;88  %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> zeroinitializer, <32 x i8> %a0)89  ret <16 x i16> %190}91 92define <32 x i16> @zero_pmaddubsw_512(<64 x i8> %a0) {93; CHECK-LABEL: @zero_pmaddubsw_512(94; CHECK-NEXT:    ret <32 x i16> zeroinitializer95;96  %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> %a0, <64 x i8> zeroinitializer)97  ret <32 x i16> %198}99 100define <32 x i16> @zero_pmaddubsw_512_commute(<64 x i8> %a0) {101; CHECK-LABEL: @zero_pmaddubsw_512_commute(102; CHECK-NEXT:    ret <32 x i16> zeroinitializer103;104  %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> zeroinitializer, <64 x i8> %a0)105  ret <32 x i16> %1106}107 108;109; Constant Folding110;111 112define <8 x i16> @fold_pmaddubsw_128() {113; CHECK-LABEL: @fold_pmaddubsw_128(114; CHECK-NEXT:    ret <8 x i16> <i16 -32768, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450>115;116  %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> <i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8> <i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>)117  ret <8 x i16> %1118}119 120define <16 x i16> @fold_pmaddubsw_256() {121; CHECK-LABEL: @fold_pmaddubsw_256(122; CHECK-NEXT:    ret <16 x i16> <i16 -32768, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450, i16 -256, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450>123;124  %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> <i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, <32 x i8> <i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>)125  ret <16 x i16> %1126}127 128define <32 x i16> @fold_pmaddubsw_512() {129; CHECK-LABEL: @fold_pmaddubsw_512(130; CHECK-NEXT:    ret <32 x i16> <i16 -32768, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450, i16 -256, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450, i16 -256, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450, i16 -32768, i16 18, i16 50, i16 1694, i16 162, i16 242, i16 338, i16 450>131;132  %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> <i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <64 x i8> <i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 -1, i8 -1, i8 2, i8 3, i8 4, i8 5, i8 -6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 -128, i8 -128, i8 3, i8 4, i8 5, i8 6, i8 7, i8 -8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>)133  ret <32 x i16> %1134}135 136;137; Demanded Elts138;139 140define <8 x i16> @elts_pmaddubsw_128(<16 x i8> %a0, <16 x i8> %a1) {141; CHECK-LABEL: @elts_pmaddubsw_128(142; CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> [[A0:%.*]], <16 x i8> [[A1:%.*]])143; CHECK-NEXT:    [[TMP2:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <8 x i32> zeroinitializer144; CHECK-NEXT:    ret <8 x i16> [[TMP2]]145;146  %1 = shufflevector <16 x i8> %a0, <16 x i8> undef, <16 x i32> <i32 0, i32 1, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>147  %2 = shufflevector <16 x i8> %a1, <16 x i8> undef, <16 x i32> <i32 0, i32 1, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>148  %3 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %1, <16 x i8> %2)149  %4 = shufflevector <8 x i16> %3, <8 x i16> poison, <8 x i32> zeroinitializer150  ret <8 x i16> %4151}152 153define <16 x i16> @elts_pmaddubsw_256(<32 x i8> %a0, <32 x i8> %a1) {154; CHECK-LABEL: @elts_pmaddubsw_256(155; CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> [[A0:%.*]], <32 x i8> [[A1:%.*]])156; CHECK-NEXT:    [[TMP2:%.*]] = shufflevector <16 x i16> [[TMP1]], <16 x i16> poison, <16 x i32> zeroinitializer157; CHECK-NEXT:    ret <16 x i16> [[TMP2]]158;159  %1 = shufflevector <32 x i8> %a0, <32 x i8> undef, <32 x i32> <i32 0, i32 1, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>160  %2 = shufflevector <32 x i8> %a1, <32 x i8> undef, <32 x i32> <i32 0, i32 1, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>161  %3 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %1, <32 x i8> %2)162  %4 = shufflevector <16 x i16> %3, <16 x i16> poison, <16 x i32> zeroinitializer163  ret <16 x i16> %4164}165 166define <32 x i16> @elts_pmaddubsw_512(<64 x i8> %a0, <64 x i8> %a1) {167; CHECK-LABEL: @elts_pmaddubsw_512(168; CHECK-NEXT:    [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> [[A0:%.*]], <64 x i8> [[A1:%.*]])169; CHECK-NEXT:    [[TMP2:%.*]] = shufflevector <32 x i16> [[TMP1]], <32 x i16> poison, <32 x i32> zeroinitializer170; CHECK-NEXT:    ret <32 x i16> [[TMP2]]171;172  %1 = shufflevector <64 x i8> %a0, <64 x i8> undef, <64 x i32> <i32 0, i32 1, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57, i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49, i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41, i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33, i32 32>173  %2 = shufflevector <64 x i8> %a1, <64 x i8> undef, <64 x i32> <i32 0, i32 1, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57, i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49, i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41, i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33, i32 32>174  %3 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> %1, <64 x i8> %2)175  %4 = shufflevector <32 x i16> %3, <32 x i16> poison, <32 x i32> zeroinitializer176  ret <32 x i16> %4177}178