Skip to content

Commit 3843dfe

Browse files
committed
[X86] Add demanded elts test coverage for vXi16 VPERMW nodes
Requested for #133923
1 parent f99072b commit 3843dfe

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

llvm/test/CodeGen/X86/vector-shuffle-combining-avx512bwvl.ll

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86
33
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64
44

5+
declare <32 x i16> @llvm.x86.avx512.permvar.hi.512(<32 x i16>, <32 x i16>)
56
declare <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)
67
declare <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)
78

@@ -183,6 +184,20 @@ define <8 x i32> @concat_vrotlv_v4i32(<4 x i32> %a0, <4 x i32> %a1, <8 x i32> %a
183184
ret <8 x i32> %shuffle
184185
}
185186

187+
define <8 x i16> @demandedelts_vpermvar_32i16_v8i16(<32 x i16> %x0) {
188+
; CHECK-LABEL: demandedelts_vpermvar_32i16_v8i16:
189+
; CHECK: # %bb.0:
190+
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm1 = [7,0,6,1,5,2,4,3,7,0,6,1,5,2,4,3,7,0,6,1,5,2,4,3,7,0,6,1,5,2,4,3]
191+
; CHECK-NEXT: # zmm1 = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
192+
; CHECK-NEXT: vpermw %zmm0, %zmm1, %zmm0
193+
; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
194+
; CHECK-NEXT: vzeroupper
195+
; CHECK-NEXT: ret{{[l|q]}}
196+
%shuffle = call <32 x i16> @llvm.x86.avx512.permvar.hi.512(<32 x i16> %x0, <32 x i16> <i16 7, i16 0, i16 6, i16 1, i16 5, i16 2, i16 4, i16 3, i16 31, i16 30, i16 29, i16 28, i16 27, i16 26, i16 25, i16 24, i16 23, i16 22, i16 21, i16 20, i16 19, i16 18, i16 17, i16 16, i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8>)
197+
%res = shufflevector <32 x i16> %shuffle, <32 x i16> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
198+
ret <8 x i16> %res
199+
}
200+
186201
define void @PR46178(ptr %0) {
187202
; X86-LABEL: PR46178:
188203
; X86: # %bb.0:
@@ -258,11 +273,11 @@ define i64 @PR55050() {
258273
; X86-NEXT: xorl %edx, %edx
259274
; X86-NEXT: xorl %eax, %eax
260275
; X86-NEXT: testb %dl, %dl
261-
; X86-NEXT: jne .LBB14_2
276+
; X86-NEXT: jne .LBB15_2
262277
; X86-NEXT: # %bb.1: # %if
263278
; X86-NEXT: xorl %eax, %eax
264279
; X86-NEXT: xorl %edx, %edx
265-
; X86-NEXT: .LBB14_2: # %exit
280+
; X86-NEXT: .LBB15_2: # %exit
266281
; X86-NEXT: retl
267282
;
268283
; X64-LABEL: PR55050:

0 commit comments

Comments
 (0)