diff options
| author | Igor Laevsky <igmyrj@gmail.com> | 2015-03-10 16:26:48 +0000 |
|---|---|---|
| committer | Igor Laevsky <igmyrj@gmail.com> | 2015-03-10 16:26:48 +0000 |
| commit | 85f7f727d38a39defb4983e145cac0081813e647 (patch) | |
| tree | 0efa6747a68245b69bd8fa01aef2f5882f667187 /llvm/test | |
| parent | 3b67c8d0f7c6a15d802c6db377af7a57e39d67ba (diff) | |
| download | bcm5719-llvm-85f7f727d38a39defb4983e145cac0081813e647.tar.gz bcm5719-llvm-85f7f727d38a39defb4983e145cac0081813e647.zip | |
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.
(Resubmitting this change after not being able to reproduce buildbot failure)
Differential Revision: http://reviews.llvm.org/D7760
llvm-svn: 231800
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/statepoint-invoke.ll | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/statepoint-invoke.ll b/llvm/test/CodeGen/X86/statepoint-invoke.ll new file mode 100644 index 00000000000..91bf46a2a20 --- /dev/null +++ b/llvm/test/CodeGen/X86/statepoint-invoke.ll @@ -0,0 +1,38 @@ +; RUN: llc < %s 2>&1 | FileCheck %s + +target triple = "x86_64-pc-linux-gnu" + +declare i64 addrspace(1)* @"some_other_call"(i64 addrspace(1)*) + +declare i32 @"personality_function"() + +define i64 addrspace(1)* @test_result(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) { +entry: + ; CHECK: .Ltmp{{[0-9]+}}: + ; CHECK: callq some_other_call + ; CHECK: .Ltmp{{[0-9]+}}: + %0 = invoke i32 (i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 addrspace(1)* (i64 addrspace(1)*)* @some_other_call, i32 1, i32 0, i64 addrspace(1)* %obj, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0, i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) + to label %normal_return unwind label %exceptional_return + +normal_return: + ; CHECK: popq + ; CHECK: retq + %ret_val = call i64 addrspace(1)* @llvm.experimental.gc.result.p1i64(i32 %0) + ret i64 addrspace(1)* %ret_val + +exceptional_return: + ; CHECK: .Ltmp{{[0-9]+}}: + ; CHECK: popq + ; CHECK: retq + %landing_pad = landingpad { i8*, i32 } personality i32 ()* @personality_function + cleanup + ret i64 addrspace(1)* %obj +} +; CHECK-LABEL: GCC_except_table{{[0-9]+}}: +; CHECK: .long .Ltmp{{[0-9]+}}-.Ltmp{{[0-9]+}} +; CHECK: .long .Ltmp{{[0-9]+}}-.Lfunc_begin{{[0-9]+}} +; CHECK: .byte 0 +; CHECK: .align 4 + +declare i32 @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) +declare i64 addrspace(1)* @llvm.experimental.gc.result.p1i64(i32) |

