1; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 | FileCheck %s 2 3declare <2 x float> @barv(<2 x float> %input) 4declare <3 x float> @barv3(<3 x float> %input) 5declare [2 x float] @bara([2 x float] %input) 6declare {float, float} @bars({float, float} %input) 7 8define void @test_v2f32(<2 x float> %input, <2 x float>* %output) { 9; CHECK-LABEL: @test_v2f32 10 %call = tail call <2 x float> @barv(<2 x float> %input) 11; CHECK: .param .align 8 .b8 retval0[8]; 12; CHECK: ld.param.v2.f32 {[[E0:%f[0-9]+]], [[E1:%f[0-9]+]]}, [retval0+0]; 13 store <2 x float> %call, <2 x float>* %output, align 8 14; CHECK: st.v2.f32 [{{%rd[0-9]+}}], {[[E0]], [[E1]]} 15 ret void 16} 17 18define void @test_v3f32(<3 x float> %input, <3 x float>* %output) { 19; CHECK-LABEL: @test_v3f32 20; 21 %call = tail call <3 x float> @barv3(<3 x float> %input) 22; CHECK: .param .align 16 .b8 retval0[16]; 23; CHECK-DAG: ld.param.v2.f32 {[[E0:%f[0-9]+]], [[E1:%f[0-9]+]]}, [retval0+0]; 24; CHECK-DAG: ld.param.f32 [[E2:%f[0-9]+]], [retval0+8]; 25; Make sure we don't load more values than than we need to. 26; CHECK-NOT: ld.param.f32 [[E3:%f[0-9]+]], [retval0+12]; 27 store <3 x float> %call, <3 x float>* %output, align 8 28; CHECK-DAG: st.f32 [{{%rd[0-9]}}+8], 29; -- This is suboptimal. We should do st.v2.f32 instead 30; of combining 2xf32 info i64. 31; CHECK-DAG: st.u64 [{{%rd[0-9]}}], 32; CHECK: ret; 33 ret void 34} 35 36define void @test_a2f32([2 x float] %input, [2 x float]* %output) { 37; CHECK-LABEL: @test_a2f32 38 %call = tail call [2 x float] @bara([2 x float] %input) 39; CHECK: .param .align 4 .b8 retval0[8]; 40; CHECK-DAG: ld.param.f32 [[ELEMA1:%f[0-9]+]], [retval0+0]; 41; CHECK-DAG: ld.param.f32 [[ELEMA2:%f[0-9]+]], [retval0+4]; 42 store [2 x float] %call, [2 x float]* %output, align 4 43; CHECK: } 44; CHECK-DAG: st.f32 [{{%rd[0-9]+}}], [[ELEMA1]] 45; CHECK-DAG: st.f32 [{{%rd[0-9]+}}+4], [[ELEMA2]] 46 ret void 47; CHECK: ret 48} 49 50define void @test_s2f32({float, float} %input, {float, float}* %output) { 51; CHECK-LABEL: @test_s2f32 52 %call = tail call {float, float} @bars({float, float} %input) 53; CHECK: .param .align 4 .b8 retval0[8]; 54; CHECK-DAG: ld.param.f32 [[ELEMS1:%f[0-9]+]], [retval0+0]; 55; CHECK-DAG: ld.param.f32 [[ELEMS2:%f[0-9]+]], [retval0+4]; 56 store {float, float} %call, {float, float}* %output, align 4 57; CHECK: } 58; CHECK-DAG: st.f32 [{{%rd[0-9]+}}], [[ELEMS1]] 59; CHECK-DAG: st.f32 [{{%rd[0-9]+}}+4], [[ELEMS2]] 60 ret void 61; CHECK: ret 62} 63