llvm/test/CodeGen/X86/x86-64-sret-return-2.ll
Reid Kleckner 17335ce80f Try to fix an SDAG dependence issue with sret
r208453 added support for having sret on the second parameter.  In that
change, the code for copying sret into a virtual register was hoisted
into the loop that lowers formal parameters.  This caused a "Wrong
topological sorting" assertion failure during scheduling when a
parameter is passed in memory.  This change undoes that by creating a
second loop that deals with sret.

I'm worried that this fix is incomplete.  I don't fully understand the
dependence issues.  However, with this change we produce the same DAGs
we used to produce, so if they are broken, they are just as broken as
they have always been.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208637 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12 22:01:27 +00:00

19 lines
579 B
LLVM

; RUN: llc -mtriple=x86_64-apple-darwin8 < %s | FileCheck %s
; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s
; FIXME: x32 doesn't know how to select this. This isn't a regression, it never
; worked.
; RUNX: llc -mtriple=x86_64-pc-linux-gnux32 < %s | FileCheck -check-prefix=X32ABI %s
; This used to crash due to topological sorting issues in selection DAG.
define void @foo(i32* sret %agg.result, i32, i32, i32, i32, i32, void (i32)* %pred) {
entry:
call void %pred(i32 undef)
ret void
; CHECK-LABEL: foo:
; CHECK: callq
; CHECK: movq {{.*}}, %rax
; CHECK: ret
}