
As reported on PR51281, an internal fuzz test encountered an issue when extracting constant bits from a SUBV_BROADCAST node from a constant pool source larger than the broadcasted subvector width. The getTargetConstantBitsFromNode was assuming that the Constant would the same size as the subvector, resulting in the incorrect packing of the per-element bits data. This patch attempts to solve this by using the SUBV_BROADCAST node to determine the subvector width, and then ensuring we extract only the lowest bits from Constant of that subvector bitsize. Differential Revision: https://reviews.llvm.org/D107158
40 lines
1.7 KiB
LLVM
40 lines
1.7 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_mem_shuffle
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
|
|
|
|
; CHECK: .LCPI0_0:
|
|
; CHECK-NEXT: .long 0x00000000
|
|
; CHECK-NEXT: .zero 4
|
|
; CHECK-NEXT: .long 0x3eb5dbc6
|
|
; CHECK-NEXT: .long 0x3eb5dbc6
|
|
; CHECK-NEXT: .zero 4
|
|
; CHECK-NEXT: .long 0x3eb5dbc6
|
|
; CHECK-NEXT: .long 0x3eb5dbc6
|
|
; CHECK-NEXT: .long 0x3eb5dbc6
|
|
|
|
; CHECK: .LCPI0_1:
|
|
; CHECK-NEXT: .long 3
|
|
; CHECK-NEXT: .long 3
|
|
; CHECK-NEXT: .long 1
|
|
; CHECK-NEXT: .long 1
|
|
; CHECK-NEXT: .long 6
|
|
; CHECK-NEXT: .long 7
|
|
; CHECK-NEXT: .long 6
|
|
; CHECK-NEXT: .long 4
|
|
|
|
define <16 x float> @PR51281(<8 x float> %a0) {
|
|
; CHECK-LABEL: PR51281:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
|
; CHECK-NEXT: vshufps {{.*#+}} xmm2 = xmm0[1,0],xmm1[3,0]
|
|
; CHECK-NEXT: vshufps {{.*#+}} xmm1 = xmm2[2,0],xmm1[1,3]
|
|
; CHECK-NEXT: vmovsldup {{.*#+}} xmm2 = xmm0[0,0,2,2]
|
|
; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
|
|
; CHECK-NEXT: vblendps $141, {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1 # ymm1 = mem[0],ymm1[1],mem[2,3],ymm1[4,5,6],mem[7]
|
|
; CHECK-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
|
|
; CHECK-NEXT: vblendps {{.*#+}} ymm0 = ymm2[0],ymm0[1],ymm2[2,3,4,5],ymm0[6],ymm2[7]
|
|
; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,1,1,6,7,6,4]
|
|
; CHECK-NEXT: retq
|
|
%shuffle = shufflevector <8 x float> %a0, <8 x float> <float poison, float 0x3FD6BB78C0000000, float poison, float poison, float poison, float poison, float 0.000000e+00, float poison>, <16 x i32> <i32 7, i32 7, i32 1, i32 1, i32 6, i32 3, i32 6, i32 0, i32 14, i32 0, i32 9, i32 9, i32 7, i32 1, i32 5, i32 9>
|
|
ret <16 x float> %shuffle
|
|
}
|