Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NVPTX] deal with all aggregate return types.
Fixes a crash in llvm_unreachable when a function has array return type. Differential Revision: https://reviews.llvm.org/D22524 llvm-svn: 276154
- Loading branch information
Showing
3 changed files
with
49 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 | FileCheck %s | ||
|
||
declare <2 x float> @barv(<2 x float> %input) | ||
declare [2 x float] @bara([2 x float] %input) | ||
declare {float, float} @bars({float, float} %input) | ||
|
||
define void @foov(<2 x float> %input, <2 x float>* %output) { | ||
; CHECK-LABEL: @foov | ||
%call = tail call <2 x float> @barv(<2 x float> %input) | ||
; CHECK: .param .align 8 .b8 retval0[8]; | ||
; CHECK: ld.param.v2.f32 {[[ELEMV1:%f[0-9]+]], [[ELEMV2:%f[0-9]+]]}, [retval0+0]; | ||
store <2 x float> %call, <2 x float>* %output, align 8 | ||
; CHECK: st.v2.f32 [{{%rd[0-9]+}}], {[[ELEMV1]], [[ELEMV2]]} | ||
ret void | ||
} | ||
|
||
define void @fooa([2 x float] %input, [2 x float]* %output) { | ||
; CHECK-LABEL: @fooa | ||
%call = tail call [2 x float] @bara([2 x float] %input) | ||
; CHECK: .param .align 4 .b8 retval0[8]; | ||
; CHECK-DAG: ld.param.f32 [[ELEMA1:%f[0-9]+]], [retval0+0]; | ||
; CHECK-DAG: ld.param.f32 [[ELEMA2:%f[0-9]+]], [retval0+4]; | ||
store [2 x float] %call, [2 x float]* %output, align 4 | ||
; CHECK: } | ||
; CHECK-DAG: st.f32 [{{%rd[0-9]+}}], [[ELEMA1]] | ||
; CHECK-DAG: st.f32 [{{%rd[0-9]+}}+4], [[ELEMA2]] | ||
ret void | ||
; CHECK: ret | ||
} | ||
|
||
define void @foos({float, float} %input, {float, float}* %output) { | ||
; CHECK-LABEL: @foos | ||
%call = tail call {float, float} @bars({float, float} %input) | ||
; CHECK: .param .align 4 .b8 retval0[8]; | ||
; CHECK-DAG: ld.param.f32 [[ELEMS1:%f[0-9]+]], [retval0+0]; | ||
; CHECK-DAG: ld.param.f32 [[ELEMS2:%f[0-9]+]], [retval0+4]; | ||
store {float, float} %call, {float, float}* %output, align 4 | ||
; CHECK: } | ||
; CHECK-DAG: st.f32 [{{%rd[0-9]+}}], [[ELEMS1]] | ||
; CHECK-DAG: st.f32 [{{%rd[0-9]+}}+4], [[ELEMS2]] | ||
ret void | ||
; CHECK: ret | ||
} |
This file was deleted.
Oops, something went wrong.