-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64] Implement spill/fill of predicate pair register classes #76068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
57faca2
[AArch64] Implement spill/fill of predicate pair register classes
momchil-velikov b179a0e
[fixup] Remove LDR_PPXI/STR_PPXI from isLoadFromStackSlot/isStorToSta…
momchil-velikov 5ea5022
[fixup] Fix upper bound of the offset for STR_PPXI/LDR_PPXI pseudos
momchil-velikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,67 @@ | ||
; RUN: llc < %s | FileCheck %s | ||
|
||
; Derived from | ||
; #include <arm_sve.h> | ||
|
||
; void g(); | ||
|
||
; svboolx2_t f0(int64_t i, int64_t n) { | ||
; svboolx2_t r = svwhilelt_b16_x2(i, n); | ||
; g(); | ||
; return r; | ||
; } | ||
|
||
; svboolx2_t f1(svcount_t n) { | ||
; svboolx2_t r = svpext_lane_c8_x2(n, 1); | ||
; g(); | ||
; return r; | ||
; } | ||
; | ||
; Check that predicate register pairs are spilled/filled without an ICE in the backend. | ||
|
||
target triple = "aarch64-unknown-linux" | ||
|
||
define <vscale x 32 x i1> @f0(i64 %i, i64 %n) #0 { | ||
entry: | ||
%0 = tail call { <vscale x 8 x i1>, <vscale x 8 x i1> } @llvm.aarch64.sve.whilelt.x2.nxv8i1(i64 %i, i64 %n) | ||
%1 = extractvalue { <vscale x 8 x i1>, <vscale x 8 x i1> } %0, 0 | ||
%2 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %1) | ||
%3 = tail call <vscale x 32 x i1> @llvm.vector.insert.nxv32i1.nxv16i1(<vscale x 32 x i1> poison, <vscale x 16 x i1> %2, i64 0) | ||
%4 = extractvalue { <vscale x 8 x i1>, <vscale x 8 x i1> } %0, 1 | ||
%5 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %4) | ||
%6 = tail call <vscale x 32 x i1> @llvm.vector.insert.nxv32i1.nxv16i1(<vscale x 32 x i1> %3, <vscale x 16 x i1> %5, i64 16) | ||
tail call void @g() | ||
ret <vscale x 32 x i1> %6 | ||
} | ||
; CHECK-LABEL: f0: | ||
; CHECK: whilelt { p0.h, p1.h } | ||
; CHECK: str p0, [sp, #6, mul vl] | ||
; CHECK: str p1, [sp, #7, mul vl] | ||
; CHECK: ldr p0, [sp, #6, mul vl] | ||
; CHECK: ldr p1, [sp, #7, mul vl] | ||
|
||
define <vscale x 32 x i1> @f1(target("aarch64.svcount") %n) #0 { | ||
entry: | ||
%0 = tail call { <vscale x 16 x i1>, <vscale x 16 x i1> } @llvm.aarch64.sve.pext.x2.nxv16i1(target("aarch64.svcount") %n, i32 1) | ||
%1 = extractvalue { <vscale x 16 x i1>, <vscale x 16 x i1> } %0, 0 | ||
%2 = tail call <vscale x 32 x i1> @llvm.vector.insert.nxv32i1.nxv16i1(<vscale x 32 x i1> poison, <vscale x 16 x i1> %1, i64 0) | ||
%3 = extractvalue { <vscale x 16 x i1>, <vscale x 16 x i1> } %0, 1 | ||
%4 = tail call <vscale x 32 x i1> @llvm.vector.insert.nxv32i1.nxv16i1(<vscale x 32 x i1> %2, <vscale x 16 x i1> %3, i64 16) | ||
tail call void @g() | ||
ret <vscale x 32 x i1> %4 | ||
} | ||
|
||
; CHECK-LABEL: f1: | ||
; CHECK: pext { p0.b, p1.b } | ||
; CHECK: str p0, [sp, #6, mul vl] | ||
; CHECK: str p1, [sp, #7, mul vl] | ||
; CHECK: ldr p0, [sp, #6, mul vl] | ||
; CHECK: ldr p1, [sp, #7, mul vl] | ||
|
||
declare void @g(...) | ||
declare { <vscale x 8 x i1>, <vscale x 8 x i1> } @llvm.aarch64.sve.whilelt.x2.nxv8i1(i64, i64) | ||
declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1>) | ||
declare <vscale x 32 x i1> @llvm.vector.insert.nxv32i1.nxv16i1(<vscale x 32 x i1>, <vscale x 16 x i1>, i64 immarg) | ||
declare { <vscale x 16 x i1>, <vscale x 16 x i1> } @llvm.aarch64.sve.pext.x2.nxv16i1(target("aarch64.svcount"), i32 immarg) #1 | ||
|
||
attributes #0 = { nounwind "target-features"="+sve,+sve2,+sve2p1" } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simm4s1
seems weird given the underlying instructions usesimm9
but then we don't target the pseudos via ISEL so I guess it doesn't really matter. It's also consistent with the existing pseudos, which also look wrong.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These offsets are checked when replacing frame index with actual addressing mode, so we know we are in range. I would suggest changing all these to
simm9
in a separate patch, if only to not make someone wonder why did we use such strange constraints.