-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NVPTX] Don't use stack memory when bitcasting to/from v2i8 #113928
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
513bf2a
b0aa1db
fc9ec25
6e16bb5
b611165
be5bc92
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda -mcpu=sm_90 -mattr=+ptx80 -asm-verbose=false \ | ||
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. Since we're already checking for most of the PTX that are generated for each function, I'd recommend auto-generating the 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. I haven't used that before but I gave it a shot and it didn't generate any checks at all for some reason, perhaps I was doing something wrong. Not sure. 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. I think you need to delete all the existing If that doesn't work (and the rest of the MR looks good), I'll just submit a follow-up patch that auto-generates the test. |
||
; RUN: -O0 -disable-post-ra -frame-pointer=all -verify-machineinstrs \ | ||
; RUN: | FileCheck %s | ||
; RUN: %if ptxas %{ \ | ||
; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda -mcpu=sm_90 -asm-verbose=false \ | ||
; RUN: -O0 -disable-post-ra -frame-pointer=all -verify-machineinstrs \ | ||
; RUN: | %ptxas-verify -arch=sm_90 \ | ||
; RUN: %} | ||
|
||
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" | ||
|
||
; CHECK-LABEL: test_bitcast_2xi8_i16( | ||
; CHECK: ld.param.u32 %r1, [test_bitcast_2xi8_i16_param_0]; | ||
; CHECK: mov.b32 {%rs1, %rs2}, %r1; | ||
; CHECK: shl.b16 %rs3, %rs2, 8; | ||
; CHECK: and.b16 %rs4, %rs1, 255; | ||
; CHECK: or.b16 %rs5, %rs4, %rs3; | ||
; CHECK: cvt.u32.u16 %r2, %rs5; | ||
; CHECK: st.param.b32 [func_retval0], %r2; | ||
define i16 @test_bitcast_2xi8_i16(<2 x i8> %a) { | ||
%res = bitcast <2 x i8> %a to i16 | ||
ret i16 %res | ||
} | ||
|
||
; CHECK-LABEL: test_bitcast_i16_2xi8( | ||
; CHECK: ld.param.u16 %rs1, [test_bitcast_i16_2xi8_param_0]; | ||
; CHECK: shr.u16 %rs2, %rs1, 8; | ||
; CHECK: mov.b32 %r1, {%rs1, %rs2}; | ||
; CHECK: st.param.b32 [func_retval0], %r1; | ||
define <2 x i8> @test_bitcast_i16_2xi8(i16 %a) { | ||
%res = bitcast i16 %a to <2 x i8> | ||
ret <2 x i8> %res | ||
} |
Uh oh!
There was an error while loading. Please reload this page.