-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[RISCV] Match deinterleave(4,8) shuffles to SHL/TRUNC when legal #118509
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,18 +19,19 @@ define {<16 x i1>, <16 x i1>} @vector_deinterleave_v16i1_v32i1(<32 x i1> %vec) { | |
; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma | ||
; CHECK-NEXT: vmv.s.x v9, a0 | ||
; CHECK-NEXT: vmv1r.v v0, v8 | ||
; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, mu | ||
; CHECK-NEXT: vmerge.vim v14, v10, 1, v0 | ||
; CHECK-NEXT: vadd.vi v8, v12, -16 | ||
; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma | ||
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. This whole sequence is more complicated than it probably needs to be. Looks like the promotion to an i8 vector interferes with the matching of a deinterleave with 2 extract_subvector inputs because the zero_extend is between the extracts and the shuffle. 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. Yeah, room for improvement, definitely. Not currently that interested in codegen, but if we decide to focus on that at some point, it's not the only one which has room for improvement. |
||
; CHECK-NEXT: vmerge.vim v8, v10, 1, v0 | ||
; CHECK-NEXT: vadd.vi v10, v12, -16 | ||
; CHECK-NEXT: vadd.vi v12, v12, -15 | ||
; CHECK-NEXT: vnsrl.wi v10, v14, 0 | ||
; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma | ||
; CHECK-NEXT: vnsrl.wi v13, v8, 0 | ||
; CHECK-NEXT: vnsrl.wi v8, v8, 8 | ||
; CHECK-NEXT: vmv1r.v v0, v9 | ||
; CHECK-NEXT: vrgather.vv v10, v11, v8, v0.t | ||
; CHECK-NEXT: vnsrl.wi v8, v14, 8 | ||
; CHECK-NEXT: vmsne.vi v10, v10, 0 | ||
; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, mu | ||
; CHECK-NEXT: vrgather.vv v13, v11, v10, v0.t | ||
; CHECK-NEXT: vrgather.vv v8, v11, v12, v0.t | ||
; CHECK-NEXT: vmsne.vi v0, v13, 0 | ||
; CHECK-NEXT: vmsne.vi v8, v8, 0 | ||
; CHECK-NEXT: vmv.v.v v0, v10 | ||
; CHECK-NEXT: ret | ||
%retval = call {<16 x i1>, <16 x i1>} @llvm.vector.deinterleave2.v32i1(<32 x i1> %vec) | ||
ret {<16 x i1>, <16 x i1>} %retval | ||
|
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.
Is the test and the one below effectively the same? Indices 8, 10, 12, 14 all point to a poison input so they should be converted to a -1 in the mask before shuffle lowering I think.
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 agree. I reworked these slightly in f947d5a to improve the coverage.