-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NVPTX] Lower 16xi8 and 8xi8 stores efficiently #73646
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 |
---|---|---|
|
@@ -37,3 +37,19 @@ define void @v16i8(ptr %a, ptr %b) { | |
store <16 x i8> %v, ptr %b | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: .visible .func v16i8_store | ||
define void @v16i8_store(ptr %a, <16 x i8> %v) { | ||
; CHECK: ld.param.u64 %rd1, [v16i8_store_param_0]; | ||
; CHECK-NEXT: ld.param.v4.u32 {%r1, %r2, %r3, %r4}, [v16i8_store_param_1]; | ||
; CHECK-NEXT: st.v4.u32 [%rd1], {%r1, %r2, %r3, %r4}; | ||
store <16 x i8> %v, ptr %a | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: .visible .func v8i8_store | ||
define void @v8i8_store(ptr %a, <8 x i8> %v) { | ||
; CHECK: st.v2.u32 | ||
store <8 x i8> %v, ptr %a | ||
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 is only correct if the pointer is aligned to a 4-byte-boundary (IIUC), but AFAIK nothing in the IR to this point promises that alignment 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. You're right. Using larger types for loads/stores must be aligned appropriately. We do use 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. In that case, we should revert it if a fix-forward is not imminent (this is breaking all of Halide's Cuda tests). |
||
ret void | ||
} |
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.
Nice. Legalizer assuming that stack loads/stores are cheap is indeed a rather bad misoptimization for NVPTX.
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.
Note that this comment might be out of date, as it looks copied from
PerformLOADCombine
and that was written before stack optimizations were done