diff options
| author | Daniel Cederman <cederman@gaisler.com> | 2018-08-17 10:40:00 +0000 |
|---|---|---|
| committer | Daniel Cederman <cederman@gaisler.com> | 2018-08-17 10:40:00 +0000 |
| commit | 0c597ca2237e02438e3a77b9882ba3e3c6c8141f (patch) | |
| tree | 62c077d747daad86f99997ad9a95c95124b346e1 /llvm/test/CodeGen/SPARC | |
| parent | 28c804a752fec77cfa8e41917304e9a378ae19eb (diff) | |
| download | bcm5719-llvm-0c597ca2237e02438e3a77b9882ba3e3c6c8141f.tar.gz bcm5719-llvm-0c597ca2237e02438e3a77b9882ba3e3c6c8141f.zip | |
[Sparc] Get sret arg size from CallLoweringInfo.getArgs()
Summary:
Looking at the callee argument list, as is done now, might not work if
the function has been typecasted into one that is expected to return
a struct. This change also simplifies the code.
The isFP128ABICall() function can be removed as it is no longer needed.
The test in fp128.ll has been updated to verify this.
Reviewers: jyknight, venkatra
Reviewed By: jyknight
Subscribers: fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D48117
llvm-svn: 340008
Diffstat (limited to 'llvm/test/CodeGen/SPARC')
| -rw-r--r-- | llvm/test/CodeGen/SPARC/cast-sret-func.ll | 17 | ||||
| -rw-r--r-- | llvm/test/CodeGen/SPARC/fp128.ll | 10 |
2 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SPARC/cast-sret-func.ll b/llvm/test/CodeGen/SPARC/cast-sret-func.ll new file mode 100644 index 00000000000..1503e278c7d --- /dev/null +++ b/llvm/test/CodeGen/SPARC/cast-sret-func.ll @@ -0,0 +1,17 @@ +; RUN: llc < %s -march=sparc + +; CHECK: call func +; CHECK: st %i0, [%sp+64] +; CHECK: unimp 8 + +%struct = type { i32, i32 } + +define void @test() nounwind { +entry: + %tmp = alloca %struct, align 4 + call void bitcast (void ()* @func to void (%struct*)*) + (%struct* nonnull sret %tmp) + ret void +} + +declare void @func() diff --git a/llvm/test/CodeGen/SPARC/fp128.ll b/llvm/test/CodeGen/SPARC/fp128.ll index bcc013b7357..535f0ef60c4 100644 --- a/llvm/test/CodeGen/SPARC/fp128.ll +++ b/llvm/test/CodeGen/SPARC/fp128.ll @@ -14,9 +14,13 @@ ; HARD: fmulq [[R4]], [[R5:.+]], [[R6:.+]] ; HARD: fdivq [[R6]], [[R2]] ; SOFT: call _Q_add +; SOFT: unimp 16 ; SOFT: call _Q_sub +; SOFT: unimp 16 ; SOFT: call _Q_mul +; SOFT: unimp 16 ; SOFT: call _Q_div +; SOFT: unimp 16 ; CHECK: std ; CHECK: std @@ -101,6 +105,7 @@ declare fp128 @llvm.fabs.f128(fp128) nounwind readonly ; CHECK-LABEL: int_to_f128: ; HARD: fitoq ; SOFT: _Q_itoq +; SOFT: unimp 16 define void @int_to_f128(fp128* noalias sret %scalar.result, i32 %i) { entry: @@ -113,6 +118,7 @@ entry: ; CHECK: ldub ; HARD: faddq ; SOFT: call _Q_add +; SOFT: unimp 16 ; CHECK: stb ; CHECK: ret @@ -128,6 +134,7 @@ entry: ; CHECK-LABEL: uint_to_f128: ; HARD: fdtoq ; SOFT: _Q_utoq +; SOFT: unimp 16 define void @uint_to_f128(fp128* noalias sret %scalar.result, i32 %i) { entry: @@ -159,8 +166,10 @@ entry: ; HARD-DAG: fitoq ; HARD-DAG: fqtoi ; SOFT-DAG: call _Q_lltoq +; SOFT-DAG: unimp 16 ; SOFT-DAG: call _Q_qtoll ; SOFT-DAG: call _Q_itoq +; SOFT-DAG: unimp 16 ; SOFT-DAG: call _Q_qtoi define void @test_itoq_qtoi(i64 %a, i32 %b, fp128* %c, fp128* %d, i64* %ptr0, fp128* %ptr1) { @@ -185,6 +194,7 @@ entry: ; HARD-DAG: fdtoq ; HARD-DAG: fqtoi ; SOFT-DAG: call _Q_utoq +; SOFT-DAG: unimp 16 ; SOFT-DAG: call _Q_qtou define void @test_utoq_qtou(i64 %a, i32 %b, fp128* %c, fp128* %d, i64* %ptr0, fp128* %ptr1) { |

