brintos

brintos / llvm-project-archived public Read only

0
0
Text · 17.9 KiB · b855d01 Raw
480 lines · plain
1; Test that DAGCombiner gets helped by computeKnownBitsForTargetNode() with2; vector intrinsics.3;4; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 < %s  | FileCheck %s5 6declare {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16>, <8 x i16>)7declare {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32>, <4 x i32>)8declare {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64>, <2 x i64>)9 10; PACKS_CC (operand elements are 0): i64 -> i3211define <4 x i32> @f0() {12; CHECK-LABEL: f0:13; CHECK-LABEL: # %bb.0:14; CHECK-NEXT:  vgbm %v24, 015; CHECK-NEXT:  br %r1416  %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> <i64 0, i64 0>, <2 x i64> <i64 0, i64 0>)17  %extr = extractvalue {<4 x i32>, i32} %call, 018  %and = and <4 x i32> %extr, <i32 1, i32 1, i32 1, i32 1>19  ret <4 x i32> %and20}21 22; PACKS_CC (operand elements are 1): i64 -> i3223; NOTE: The vector AND is optimized away, but vrepig+vpksgs is used instead24; of vrepif. Similarly for more test cases below.25define <4 x i32> @f1() {26; CHECK-LABEL: f1:27; CHECK-LABEL: # %bb.0:28; CHECK-NEXT:  vrepig %v0, 129; CHECK-NEXT:  vpksgs %v24, %v0, %v030; CHECK-NEXT:  br %r1431  %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> <i64 1, i64 1>, <2 x i64> <i64 1, i64 1>)32  %extr = extractvalue {<4 x i32>, i32} %call, 033  %and = and <4 x i32> %extr, <i32 1, i32 1, i32 1, i32 1>34  ret <4 x i32> %and35}36 37; PACKS_CC (operand elements are 0): i32 -> i1638define <8 x i16> @f2() {39; CHECK-LABEL: f2:40; CHECK-LABEL: # %bb.0:41; CHECK-NEXT:  vgbm %v24, 042; CHECK-NEXT:  br %r1443  %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> <i32 0, i32 0, i32 0, i32 0>,44                                                  <4 x i32> <i32 0, i32 0, i32 0, i32 0>)45  %extr = extractvalue {<8 x i16>, i32} %call, 046  %and = and <8 x i16> %extr, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>47  ret <8 x i16> %and48}49 50; PACKS_CC (operand elements are 1): i32 -> i1651define <8 x i16> @f3() {52; CHECK-LABEL: f3:53; CHECK-LABEL: # %bb.0:54; CHECK-NEXT:  vrepif %v0, 155; CHECK-NEXT:  vpksfs %v24, %v0, %v056; CHECK-NEXT:  br %r1457  %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> <i32 1, i32 1, i32 1, i32 1>,58                                                  <4 x i32> <i32 1, i32 1, i32 1, i32 1>)59  %extr = extractvalue {<8 x i16>, i32} %call, 060  %and = and <8 x i16> %extr, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>61  ret <8 x i16> %and62}63 64; PACKS_CC (operand elements are 0): i16 -> i865define <16 x i8> @f4() {66; CHECK-LABEL: f4:67; CHECK-LABEL: # %bb.0:68; CHECK-NEXT:  vgbm %v24, 069; CHECK-NEXT:  br %r1470  %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(71                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>,72                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>)73  %extr = extractvalue {<16 x i8>, i32} %call, 074  %and = and <16 x i8> %extr, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,75                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>76  ret <16 x i8> %and77}78 79; PACKS_CC (operand elements are 1): i16 -> i880define <16 x i8> @f5() {81; CHECK-LABEL: f5:82; CHECK-LABEL: # %bb.0:83; CHECK-NEXT:  vrepih %v0, 184; CHECK-NEXT:  vpkshs %v24, %v0, %v085; CHECK-NEXT:  br %r1486  %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(87                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>,88                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)89  %extr = extractvalue {<16 x i8>, i32} %call, 090  %and = and <16 x i8> %extr, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,91                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>92  ret <16 x i8> %and93}94 95declare {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16>, <8 x i16>)96declare {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32>, <4 x i32>)97declare {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64>, <2 x i64>)98 99; PACKLS_CC (operand elements are 0): i64 -> i32100define <4 x i32> @f6() {101; CHECK-LABEL: f6:102; CHECK-LABEL: # %bb.0:103; CHECK-NEXT:  vgbm %v24, 0104; CHECK-NEXT:  br %r14105  %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> <i64 0, i64 0>, <2 x i64> <i64 0, i64 0>)106  %extr = extractvalue {<4 x i32>, i32} %call, 0107  %and = and <4 x i32> %extr, <i32 1, i32 1, i32 1, i32 1>108  ret <4 x i32> %and109}110 111; PACKLS_CC (operand elements are 1): i64 -> i32112define <4 x i32> @f7() {113; CHECK-LABEL: f7:114; CHECK-LABEL: # %bb.0:115; CHECK-NEXT:  vrepig %v0, 1116; CHECK-NEXT:  vpklsgs %v24, %v0, %v0117; CHECK-NEXT:  br %r14118  %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> <i64 1, i64 1>, <2 x i64> <i64 1, i64 1>)119  %extr = extractvalue {<4 x i32>, i32} %call, 0120  %and = and <4 x i32> %extr, <i32 1, i32 1, i32 1, i32 1>121  ret <4 x i32> %and122}123 124; PACKLS_CC (operand elements are 0): i32 -> i16125define <8 x i16> @f8() {126; CHECK-LABEL: f8:127; CHECK-LABEL: # %bb.0:128; CHECK-NEXT:  vgbm %v24, 0129; CHECK-NEXT:  br %r14130  %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> <i32 0, i32 0, i32 0, i32 0>,131                                                  <4 x i32> <i32 0, i32 0, i32 0, i32 0>)132  %extr = extractvalue {<8 x i16>, i32} %call, 0133  %and = and <8 x i16> %extr, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>134  ret <8 x i16> %and135}136 137; PACKLS_CC (operand elements are 1): i32 -> i16138define <8 x i16> @f9() {139; CHECK-LABEL: f9:140; CHECK-LABEL: # %bb.0:141; CHECK-NEXT:  vrepif %v0, 1142; CHECK-NEXT:  vpklsfs %v24, %v0, %v0143; CHECK-NEXT:  br %r14144  %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> <i32 1, i32 1, i32 1, i32 1>,145                                                  <4 x i32> <i32 1, i32 1, i32 1, i32 1>)146  %extr = extractvalue {<8 x i16>, i32} %call, 0147  %and = and <8 x i16> %extr, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>148  ret <8 x i16> %and149}150 151; PACKLS_CC (operand elements are 0): i16 -> i8152define <16 x i8> @f10() {153; CHECK-LABEL: f10:154; CHECK-LABEL: # %bb.0:155; CHECK-NEXT:  vgbm %v24, 0156; CHECK-NEXT:  br %r14157  %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(158                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>,159                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>)160  %extr = extractvalue {<16 x i8>, i32} %call, 0161  %and = and <16 x i8> %extr, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,162                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>163  ret <16 x i8> %and164}165 166; PACKLS_CC (operand elements are 1): i16 -> i8167define <16 x i8> @f11() {168; CHECK-LABEL: f11:169; CHECK-LABEL: # %bb.0:170; CHECK-NEXT:  vrepih %v0, 1171; CHECK-NEXT:  vpklshs %v24, %v0, %v0172; CHECK-NEXT:  br %r14173  %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(174                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>,175                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)176  %extr = extractvalue {<16 x i8>, i32} %call, 0177  %and = and <16 x i8> %extr, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,178                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>179  ret <16 x i8> %and180}181 182declare <16 x i8> @llvm.s390.vpksh(<8 x i16>, <8 x i16>)183declare <8 x i16> @llvm.s390.vpksf(<4 x i32>, <4 x i32>)184declare <4 x i32> @llvm.s390.vpksg(<2 x i64>, <2 x i64>)185 186; PACKS (operand elements are 0): i64 -> i32187define <4 x i32> @f12() {188; CHECK-LABEL: f12:189; CHECK-LABEL: # %bb.0:190; CHECK-NEXT:  vgbm %v24, 0191; CHECK-NEXT:  br %r14192  %call = call <4 x i32> @llvm.s390.vpksg(<2 x i64> <i64 0, i64 0>, <2 x i64> <i64 0, i64 0>)193  %and = and <4 x i32> %call, <i32 1, i32 1, i32 1, i32 1>194  ret <4 x i32> %and195}196 197; PACKS (operand elements are 1): i64 -> i32198define <4 x i32> @f13() {199; CHECK-LABEL: f13:200; CHECK-LABEL: # %bb.0:201; CHECK-NEXT:  vrepig %v0, 1202; CHECK-NEXT:  vpksg %v24, %v0, %v0203; CHECK-NEXT:  br %r14204  %call = call <4 x i32> @llvm.s390.vpksg(<2 x i64> <i64 1, i64 1>, <2 x i64> <i64 1, i64 1>)205  %and = and <4 x i32> %call, <i32 1, i32 1, i32 1, i32 1>206  ret <4 x i32> %and207}208 209; PACKS (operand elements are 0): i32 -> i16210define <8 x i16> @f14() {211; CHECK-LABEL: f14:212; CHECK-LABEL: # %bb.0:213; CHECK-NEXT:  vgbm %v24, 0214; CHECK-NEXT:  br %r14215  %call = call <8 x i16> @llvm.s390.vpksf(<4 x i32> <i32 0, i32 0, i32 0, i32 0>,216                                          <4 x i32> <i32 0, i32 0, i32 0, i32 0>)217  %and = and <8 x i16> %call, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>218  ret <8 x i16> %and219}220 221; PACKS (operand elements are 1): i32 -> i16222define <8 x i16> @f15() {223; CHECK-LABEL: f15:224; CHECK-LABEL: # %bb.0:225; CHECK-NEXT:  vrepif %v0, 1226; CHECK-NEXT:  vpksf %v24, %v0, %v0227; CHECK-NEXT:  br %r14228  %call = call <8 x i16> @llvm.s390.vpksf(<4 x i32> <i32 1, i32 1, i32 1, i32 1>,229                                          <4 x i32> <i32 1, i32 1, i32 1, i32 1>)230  %and = and <8 x i16> %call, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>231  ret <8 x i16> %and232}233 234; PACKS (operand elements are 0): i16 -> i8235define <16 x i8> @f16() {236; CHECK-LABEL: f16:237; CHECK-LABEL: # %bb.0:238; CHECK-NEXT:  vgbm %v24, 0239; CHECK-NEXT:  br %r14240  %call = call <16 x i8> @llvm.s390.vpksh(241                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>,242                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>)243  %and = and <16 x i8> %call, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,244                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>245  ret <16 x i8> %and246}247 248; PACKS (operand elements are 1): i16 -> i8249define <16 x i8> @f17() {250; CHECK-LABEL: f17:251; CHECK-LABEL: # %bb.0:252; CHECK-NEXT:  vrepih %v0, 1253; CHECK-NEXT:  vpksh %v24, %v0, %v0254; CHECK-NEXT:  br %r14255  %call = call <16 x i8> @llvm.s390.vpksh(256                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>,257                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)258  %and = and <16 x i8> %call, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,259                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>260  ret <16 x i8> %and261}262 263declare <16 x i8> @llvm.s390.vpklsh(<8 x i16>, <8 x i16>)264declare <8 x i16> @llvm.s390.vpklsf(<4 x i32>, <4 x i32>)265declare <4 x i32> @llvm.s390.vpklsg(<2 x i64>, <2 x i64>)266 267; PACKLS (operand elements are 0): i64 -> i32268define <4 x i32> @f18() {269; CHECK-LABEL: f18:270; CHECK-LABEL: # %bb.0:271; CHECK-NEXT:  vgbm %v24, 0272; CHECK-NEXT:  br %r14273  %call = call <4 x i32> @llvm.s390.vpklsg(<2 x i64> <i64 0, i64 0>, <2 x i64> <i64 0, i64 0>)274  %and = and <4 x i32> %call, <i32 1, i32 1, i32 1, i32 1>275  ret <4 x i32> %and276}277 278; PACKLS (operand elements are 1): i64 -> i32279define <4 x i32> @f19() {280; CHECK-LABEL: f19:281; CHECK-LABEL: # %bb.0:282; CHECK-NEXT:  vrepig %v0, 1283; CHECK-NEXT:  vpklsg %v24, %v0, %v0284; CHECK-NEXT:  br %r14285  %call = call <4 x i32> @llvm.s390.vpklsg(<2 x i64> <i64 1, i64 1>, <2 x i64> <i64 1, i64 1>)286  %and = and <4 x i32> %call, <i32 1, i32 1, i32 1, i32 1>287  ret <4 x i32> %and288}289 290; PACKLS (operand elements are 0): i32 -> i16291define <8 x i16> @f20() {292; CHECK-LABEL: f20:293; CHECK-LABEL: # %bb.0:294; CHECK-NEXT:  vgbm %v24, 0295; CHECK-NEXT:  br %r14296  %call = call <8 x i16> @llvm.s390.vpklsf(<4 x i32> <i32 0, i32 0, i32 0, i32 0>,297                                           <4 x i32> <i32 0, i32 0, i32 0, i32 0>)298  %and = and <8 x i16> %call, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>299  ret <8 x i16> %and300}301 302; PACKLS (operand elements are 1): i32 -> i16303define <8 x i16> @f21() {304; CHECK-LABEL: f21:305; CHECK-LABEL: # %bb.0:306; CHECK-NEXT:  vrepif %v0, 1307; CHECK-NEXT:  vpklsf %v24, %v0, %v0308; CHECK-NEXT:  br %r14309  %call = call <8 x i16> @llvm.s390.vpklsf(<4 x i32> <i32 1, i32 1, i32 1, i32 1>,310                                           <4 x i32> <i32 1, i32 1, i32 1, i32 1>)311  %and = and <8 x i16> %call, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>312  ret <8 x i16> %and313}314 315; PACKLS (operand elements are 0): i16 -> i8316define <16 x i8> @f22() {317; CHECK-LABEL: f22:318; CHECK-LABEL: # %bb.0:319; CHECK-NEXT:  vgbm %v24, 0320; CHECK-NEXT:  br %r14321  %call = call <16 x i8> @llvm.s390.vpklsh(322                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>,323                <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>)324  %and = and <16 x i8> %call, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,325                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>326  ret <16 x i8> %and327}328 329; PACKLS (operand elements are 1): i16 -> i8330define <16 x i8> @f23() {331; CHECK-LABEL: f23:332; CHECK-LABEL: # %bb.0:333; CHECK-NEXT:  vrepih %v0, 1334; CHECK-NEXT:  vpklsh %v24, %v0, %v0335; CHECK-NEXT:  br %r14336  %call = call <16 x i8> @llvm.s390.vpklsh(337                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>,338                <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)339  %and = and <16 x i8> %call, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,340                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>341  ret <16 x i8> %and342}343 344declare <2 x i64> @llvm.s390.vpdi(<2 x i64>, <2 x i64>, i32)345 346; VPDI (operand elements are 0):347define <2 x i64> @f24() {348; CHECK-LABEL: f24:349; CHECK-LABEL: # %bb.0:350; CHECK-NEXT: vgbm %v24, 0351; CHECK-NEXT: br %r14352  %perm = call <2 x i64> @llvm.s390.vpdi(<2 x i64> <i64 0, i64 0>,353                                         <2 x i64> <i64 0, i64 0>, i32 0)354  %res = and <2 x i64> %perm, <i64 1, i64 1>355  ret <2 x i64> %res356}357 358; VPDI (operand elements are 1):359define <2 x i64> @f25() {360; CHECK-LABEL: f25:361; CHECK-LABEL: # %bb.0:362; CHECK-NEXT: vrepig %v0, 1363; CHECK-NEXT: vpdi %v24, %v0, %v0, 0364; CHECK-NEXT: br %r14365  %perm = call <2 x i64> @llvm.s390.vpdi(<2 x i64> <i64 1, i64 1>,366                                         <2 x i64> <i64 1, i64 1>, i32 0)367  %res = and <2 x i64> %perm, <i64 1, i64 1>368  ret <2 x i64> %res369}370 371declare <16 x i8> @llvm.s390.vsldb(<16 x i8>, <16 x i8>, i32)372 373; VSLDB (operand elements are 0):374define <16 x i8> @f26() {375; CHECK-LABEL: f26:376; CHECK-LABEL: # %bb.0:377; CHECK-NEXT: vgbm %v24, 0378; CHECK-NEXT: br %r14379  %shfd = call <16 x i8> @llvm.s390.vsldb(<16 x i8>380                 <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,381                  i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x i8>382                 <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,383                  i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>,384                  i32 1)385 386  %res = and <16 x i8> %shfd, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,387                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>388  ret <16 x i8> %res389}390 391; VSLDB (operand elements are 1):392define <16 x i8> @f27() {393; CHECK-LABEL: f27:394; CHECK-LABEL: # %bb.0:395; CHECK-NEXT: vrepib %v0, 1396; CHECK-NEXT: vsldb %v24, %v0, %v0, 1397; CHECK-NEXT: br %r14398  %shfd = call <16 x i8> @llvm.s390.vsldb(<16 x i8>399                 <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,400                  i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, <16 x i8>401                 <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,402                  i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>,403                  i32 1)404 405  %res = and <16 x i8> %shfd, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,406                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>407  ret <16 x i8> %res408}409 410; Test that intrinsic CC result is recognized.411define i32 @f28(<4 x i32> %a, <4 x i32> %b) {412; CHECK-LABEL: f28:413; CHECK-LABEL: # %bb.0:414; CHECK-NEXT: lhi %r2, 0415; CHECK-NEXT: br %r14416  %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)417  %cc = extractvalue {<8 x i16>, i32} %call, 1418  %res = and i32 %cc, -4419  ret i32 %res420}421 422declare <16 x i8> @llvm.s390.vperm(<16 x i8>, <16 x i8>, <16 x i8>)423 424; Test VPERM (operand elements are 0):425define <16 x i8> @f29() {426; CHECK-LABEL: f29:427; CHECK-LABEL: # %bb.0:428; CHECK-NEXT: vgbm %v24, 0429; CHECK-NEXT: br %r14430  %perm = call <16 x i8> @llvm.s390.vperm(431                  <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,432                             i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>,433                  <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,434                             i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>,435                  <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,436                             i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>)437  %res = and <16 x i8> %perm, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,438                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>439  ret <16 x i8> %res440}441 442; Test VPERM (operand elements are 1):443define <16 x i8> @f30() {444; CHECK-LABEL: f30:445; CHECK-LABEL: # %bb.0:446; CHECK-NEXT: vgbm %v0, 0447; CHECK-NEXT: vrepib %v1, 1448; CHECK-NEXT: vperm %v24, %v1, %v1, %v0449; CHECK-NEXT: br %r14450  %perm = call <16 x i8> @llvm.s390.vperm(451                  <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,452                             i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>,453                  <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,454                             i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>,455                  <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0,456                             i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>)457  %res = and <16 x i8> %perm, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,458                               i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>459  ret <16 x i8> %res460}461 462; Test VPERM with various constant operands.463define i32 @f31() {464; CHECK-LABEL: f31:465; CHECK-LABEL: # %bb.0:466; CHECK-NEXT: larl %r1, .LCPI31_0467; CHECK-NEXT: vl %v0, 0(%r1), 3468; CHECK-NEXT: larl %r1, .LCPI31_1469; CHECK-NEXT: vl %v1, 0(%r1), 3470; CHECK-NEXT: vperm %v0, %v1, %v1, %v0471; CHECK-NEXT: vlgvb %r2, %v0, 0472; CHECK-NEXT: nilf %r2, 7473; CHECK-NEXT:                           # kill: def $r2l killed $r2l killed $r2d474; CHECK-NEXT: br %r14475  %P = tail call <16 x i8> @llvm.s390.vperm(<16 x i8> <i8 0, i8 1, i8 1, i8 2, i8 1, i8 2, i8 2, i8 3, i8 1, i8 2, i8 2, i8 3, i8 2, i8 3, i8 3, i8 4>, <16 x i8> <i8 0, i8 1, i8 1, i8 2, i8 1, i8 2, i8 2, i8 3, i8 1, i8 2, i8 2, i8 3, i8 2, i8 3, i8 3, i8 4>, <16 x i8> <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 0>)476  %E = extractelement <16 x i8> %P, i64 0477  %res = zext i8 %E to i32478  ret i32 %res479}480