Legalize sret call arguments

This commit is contained in:
teapotd
2020-05-25 19:57:43 +02:00
parent b18846057f
commit 9e70a64728
2 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
test legalizer
target x86_64 haswell
;; Test if arguments are legalized if function uses sret
function %call_indirect_with_split_arg(i64, i64, i64) {
; check: ss0 = sret_slot 32
sig0 = (i128) -> i64, i64, i64, i64
; check: sig0 = (i64 [%rsi], i64 [%rdx], i64 sret [%rdi]) -> i64 sret [%rax] fast
block0(v0: i64, v1: i64, v2: i64):
v3 = iconcat v1, v2
v4, v5, v6, v7 = call_indirect sig0, v0(v3)
; check: v8 = stack_addr.i64 ss0
; check: v9 = call_indirect sig0, v0(v1, v2, v8)
; check: v10 = load.i64 notrap aligned v9
; check: v4 -> v10
; check: v11 = load.i64 notrap aligned v9+8
; check: v5 -> v11
; check: v12 = load.i64 notrap aligned v9+16
; check: v6 -> v12
; check: v13 = load.i64 notrap aligned v9+24
; check: v7 -> v13
return
}