-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[LegalizeTypes][RISCV] Use SPLAT_VECTOR_PARTS to legalize splat BUILD_VECTOR #107290
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 all commits
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 |
---|---|---|
|
@@ -14,9 +14,11 @@ define <1 x i64> @llrint_v1i64_v1f32(<1 x float> %x) { | |
; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma | ||
; RV32-NEXT: vfmv.f.s fa0, v8 | ||
; RV32-NEXT: call llrintf | ||
; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma | ||
; RV32-NEXT: vmv.v.x v8, a0 | ||
; RV32-NEXT: vslide1down.vx v8, v8, a1 | ||
; RV32-NEXT: sw a1, 4(sp) | ||
; RV32-NEXT: sw a0, 0(sp) | ||
; RV32-NEXT: mv a0, sp | ||
; RV32-NEXT: vsetivli zero, 1, e64, 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. Given the results on short VL, we'd probably be better going through the buildvector lowering, or adapting some of that lowering to work on short splat_vector_parts. Using the strided load may not always be our best fallback. (Optional follow up only) 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. Agree. The strided load is not good given what we know now about microarchitectures. |
||
; RV32-NEXT: vlse64.v v8, (a0), zero | ||
; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload | ||
; RV32-NEXT: addi sp, sp, 16 | ||
; RV32-NEXT: ret | ||
|
@@ -669,9 +671,11 @@ define <1 x i64> @llrint_v1i64_v1f64(<1 x double> %x) { | |
; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma | ||
; RV32-NEXT: vfmv.f.s fa0, v8 | ||
; RV32-NEXT: call llrint | ||
; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma | ||
; RV32-NEXT: vmv.v.x v8, a0 | ||
; RV32-NEXT: vslide1down.vx v8, v8, a1 | ||
; RV32-NEXT: sw a1, 4(sp) | ||
; RV32-NEXT: sw a0, 0(sp) | ||
; RV32-NEXT: mv a0, sp | ||
; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma | ||
; RV32-NEXT: vlse64.v v8, (a0), zero | ||
; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload | ||
; RV32-NEXT: addi sp, sp, 16 | ||
; RV32-NEXT: ret | ||
|
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.
Why do we need the SPLAT_VECTOR legality? Isn't SPLAT_VECTOR_PARTS enough?
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 think we don't default SPLAT_VECTOR_PARTS to Expand so it started crashing other targets.