-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[IA] Support deinterleave intrinsics w/ fewer than N extracts #147572
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
2 commits
Select commit
Hold shift + click to select a range
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
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 |
---|---|---|
|
@@ -52,9 +52,8 @@ define {<vscale x 16 x i8>, <vscale x 16 x i8>} @vector_deinterleave_load_nxv16i | |
define <vscale x 16 x i8> @vector_deinterleave_load_nxv16i8_nxv32i8_oneactive(ptr %p) { | ||
; CHECK-LABEL: vector_deinterleave_load_nxv16i8_nxv32i8_oneactive: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: vl4r.v v12, (a0) | ||
; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma | ||
; CHECK-NEXT: vnsrl.wi v8, v12, 0 | ||
; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma | ||
; CHECK-NEXT: vlseg2e8.v v8, (a0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, this is a missed optimization which will follow in a separate patch. We should be using the strided load for the single active case. We do this for the shuffle path, but not for the intrinsic path. |
||
; CHECK-NEXT: ret | ||
%vec = load <vscale x 32 x i8>, ptr %p | ||
%deinterleaved.results = call {<vscale x 16 x i8>, <vscale x 16 x i8>} @llvm.vector.deinterleave2.nxv32i8(<vscale x 32 x i8> %vec) | ||
|
@@ -65,9 +64,8 @@ define <vscale x 16 x i8> @vector_deinterleave_load_nxv16i8_nxv32i8_oneactive(pt | |
define <vscale x 16 x i8> @vector_deinterleave_load_nxv16i8_nxv32i8_oneactive2(ptr %p) { | ||
; CHECK-LABEL: vector_deinterleave_load_nxv16i8_nxv32i8_oneactive2: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: vl4r.v v12, (a0) | ||
; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma | ||
; CHECK-NEXT: vnsrl.wi v8, v12, 8 | ||
; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma | ||
; CHECK-NEXT: vlseg2e8.v v6, (a0) | ||
; CHECK-NEXT: ret | ||
%vec = load <vscale x 32 x i8>, ptr %p | ||
%deinterleaved.results = call {<vscale x 16 x i8>, <vscale x 16 x i8>} @llvm.vector.deinterleave2.nxv32i8(<vscale x 32 x i8> %vec) | ||
|
@@ -409,23 +407,8 @@ define { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x | |
define <vscale x 8 x i8> @vector_deinterleave_load_factor4_oneactive(ptr %p) { | ||
; CHECK-LABEL: vector_deinterleave_load_factor4_oneactive: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: addi sp, sp, -16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
; CHECK-NEXT: csrr a1, vlenb | ||
; CHECK-NEXT: slli a1, a1, 2 | ||
; CHECK-NEXT: sub sp, sp, a1 | ||
; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb | ||
; CHECK-NEXT: vl4r.v v8, (a0) | ||
; CHECK-NEXT: addi a0, sp, 16 | ||
; CHECK-NEXT: vs4r.v v8, (a0) | ||
; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma | ||
; CHECK-NEXT: vlseg4e8.v v8, (a0) | ||
; CHECK-NEXT: csrr a0, vlenb | ||
; CHECK-NEXT: slli a0, a0, 2 | ||
; CHECK-NEXT: add sp, sp, a0 | ||
; CHECK-NEXT: .cfi_def_cfa sp, 16 | ||
; CHECK-NEXT: addi sp, sp, 16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 0 | ||
; CHECK-NEXT: ret | ||
%vec = load <vscale x 32 x i8>, ptr %p | ||
%d0 = call { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } @llvm.vector.deinterleave4(<vscale x 32 x i8> %vec) | ||
|
@@ -436,23 +419,8 @@ define <vscale x 8 x i8> @vector_deinterleave_load_factor4_oneactive(ptr %p) { | |
define <vscale x 8 x i8> @vector_deinterleave_load_factor4_oneactive2(ptr %p) { | ||
; CHECK-LABEL: vector_deinterleave_load_factor4_oneactive2: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: addi sp, sp, -16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
; CHECK-NEXT: csrr a1, vlenb | ||
; CHECK-NEXT: slli a1, a1, 2 | ||
; CHECK-NEXT: sub sp, sp, a1 | ||
; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb | ||
; CHECK-NEXT: vl4r.v v8, (a0) | ||
; CHECK-NEXT: addi a0, sp, 16 | ||
; CHECK-NEXT: vs4r.v v8, (a0) | ||
; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma | ||
; CHECK-NEXT: vlseg4e8.v v5, (a0) | ||
; CHECK-NEXT: csrr a0, vlenb | ||
; CHECK-NEXT: slli a0, a0, 2 | ||
; CHECK-NEXT: add sp, sp, a0 | ||
; CHECK-NEXT: .cfi_def_cfa sp, 16 | ||
; CHECK-NEXT: addi sp, sp, 16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 0 | ||
; CHECK-NEXT: ret | ||
%vec = load <vscale x 32 x i8>, ptr %p | ||
%d0 = call { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } @llvm.vector.deinterleave4(<vscale x 32 x i8> %vec) | ||
|
@@ -463,23 +431,8 @@ define <vscale x 8 x i8> @vector_deinterleave_load_factor4_oneactive2(ptr %p) { | |
define { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } @vector_deinterleave_load_factor4_twoactive(ptr %p) { | ||
; CHECK-LABEL: vector_deinterleave_load_factor4_twoactive: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: addi sp, sp, -16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
; CHECK-NEXT: csrr a1, vlenb | ||
; CHECK-NEXT: slli a1, a1, 2 | ||
; CHECK-NEXT: sub sp, sp, a1 | ||
; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb | ||
; CHECK-NEXT: vl4r.v v8, (a0) | ||
; CHECK-NEXT: addi a0, sp, 16 | ||
; CHECK-NEXT: vs4r.v v8, (a0) | ||
; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma | ||
; CHECK-NEXT: vlseg4e8.v v8, (a0) | ||
; CHECK-NEXT: csrr a0, vlenb | ||
; CHECK-NEXT: slli a0, a0, 2 | ||
; CHECK-NEXT: add sp, sp, a0 | ||
; CHECK-NEXT: .cfi_def_cfa sp, 16 | ||
; CHECK-NEXT: addi sp, sp, 16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 0 | ||
; CHECK-NEXT: ret | ||
%vec = load <vscale x 32 x i8>, ptr %p | ||
%d0 = call { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } @llvm.vector.deinterleave4(<vscale x 32 x i8> %vec) | ||
|
Oops, something went wrong.
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.
Should we just plumb through
LastFactor->getType()
to save TLIs from having to do find_if on the DeinterleaveValues each time?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.
I'm going to be looking at reworking this interface in a couple of upcoming patches, I'll try this and see how it works out.