forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Ensure VPERMV3 -> VPERMV fold comes from a double width vector
llvm#96414 + llvm#97206 didn't ensure that we were extracting subvectors from a vector double the width of the destination. We can relax this in a future patch, but fix the llvm#97968 crash first. Fixes llvm#97968
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver4 | FileCheck %s | ||
|
||
define <2 x i32> @PR97968(<16 x i32> %a0) { | ||
; CHECK-LABEL: PR97968: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: vpbroadcastq {{.*#+}} xmm1 = [2,7,2,7] | ||
; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm2 | ||
; CHECK-NEXT: vpermi2d %xmm2, %xmm0, %xmm1 | ||
; CHECK-NEXT: vmovdqa %xmm1, %xmm0 | ||
; CHECK-NEXT: vzeroupper | ||
; CHECK-NEXT: retq | ||
%sub0 = shufflevector <16 x i32> %a0, <16 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> | ||
%sub1 = shufflevector <16 x i32> %a0, <16 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> | ||
%elt0 = extractelement <4 x i32> %sub0, i64 2 | ||
%elt7 = extractelement <4 x i32> %sub1, i64 3 | ||
%scl0 = insertelement <2 x i32> undef, i32 %elt0, i32 0 | ||
%scl1 = insertelement <2 x i32> %scl0, i32 %elt7, i32 1 | ||
ret <2 x i32> %scl1 | ||
} |