-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][GlobalISel] Lower shuffle vector with scalar destinations. (#…
…121384) I believe these are usually canonicalized to vector extracts in most situations, but under -O0 we might trigger failures in the widening code if we do not handle scalar destinations correctly. The simplest solution should be to lower the shuffle to an extract. Fixes #121365.
- Loading branch information
1 parent
5056a4b
commit 71d6b0b
Showing
3 changed files
with
76 additions
and
3 deletions.
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
43 changes: 43 additions & 0 deletions
43
llvm/test/CodeGen/AArch64/GlobalISel/legalize-shuffle-1x.ll
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,43 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc -mtriple aarch64 -O0 -global-isel -o - %s | FileCheck %s | ||
|
||
define <1 x i1> @shuffle_extract_4(<8 x i1> %a, <8 x i1> %b) { | ||
; CHECK-LABEL: shuffle_extract_4: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: ushll v0.8h, v0.8b, #0 | ||
; CHECK-NEXT: umov w8, v0.h[4] | ||
; CHECK-NEXT: and w0, w8, #0x1 | ||
; CHECK-NEXT: ret | ||
%extractvec60 = shufflevector <8 x i1> %a, <8 x i1> %b, <1 x i32> <i32 4> | ||
ret <1 x i1> %extractvec60 | ||
} | ||
|
||
define <1 x i1> @shuffle_extract_12(<8 x i1> %a, <8 x i1> %b) { | ||
; CHECK-LABEL: shuffle_extract_12: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: ushll v0.8h, v1.8b, #0 | ||
; CHECK-NEXT: umov w8, v0.h[4] | ||
; CHECK-NEXT: and w0, w8, #0x1 | ||
; CHECK-NEXT: ret | ||
%extractvec60 = shufflevector <8 x i1> %a, <8 x i1> %b, <1 x i32> <i32 12> | ||
ret <1 x i1> %extractvec60 | ||
} | ||
|
||
define <1 x i1> @shuffle_extract_p(<8 x i1> %a, <8 x i1> %b) { | ||
; CHECK-LABEL: shuffle_extract_p: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: // implicit-def: $w8 | ||
; CHECK-NEXT: and w0, w8, #0x1 | ||
; CHECK-NEXT: ret | ||
%extractvec60 = shufflevector <8 x i1> %a, <8 x i1> %b, <1 x i32> <i32 poison> | ||
ret <1 x i1> %extractvec60 | ||
} | ||
|
||
define <1 x i32> @shufflevector_v1i32(<1 x i32> %a, <1 x i32> %b) { | ||
; CHECK-LABEL: shufflevector_v1i32: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: fmov d0, d1 | ||
; CHECK-NEXT: ret | ||
%c = shufflevector <1 x i32> %a, <1 x i32> %b, <1 x i32> <i32 1> | ||
ret <1 x i32> %c | ||
} |
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