diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2018-03-02 20:39:30 +0000 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2018-03-02 20:39:30 +0000 |
| commit | 5eb64110d241cf2506f54ade3c2693beed42dd8f (patch) | |
| tree | 7ae56e435fdaeb9440ac5068e1317ad465f6130a /llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll | |
| parent | 32063888700f57bf57ede4f24efb727fd3f284c5 (diff) | |
| download | bcm5719-llvm-5eb64110d241cf2506f54ade3c2693beed42dd8f.tar.gz bcm5719-llvm-5eb64110d241cf2506f54ade3c2693beed42dd8f.zip | |
[SystemZ] Support stackmaps and patchpoints
This adds back-end support for the @llvm.experimental.stackmap and
@llvm.experimental.patchpoint intrinsics.
llvm-svn: 326611
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll')
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll b/llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll new file mode 100644 index 00000000000..a9bb7acd589 --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/patchpoint-invoke.ll @@ -0,0 +1,65 @@ +; RUN: llc -mtriple=s390x-linux-gnu < %s | FileCheck %s + +; Test invoking of patchpoints +; +define i64 @patchpoint_invoke(i64 %p1, i64 %p2) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +entry: +; CHECK-LABEL: patchpoint_invoke: +; CHECK-NEXT: [[FUNC_BEGIN:.L.*]]: +; CHECK-NEXT: .cfi_startproc +; CHECK: .cfi_lsda 0, [[EXCEPTION_LABEL:.L[^ ]*]] +; CHECK: aghi %r15, -160 + +; Unfortunately, hardcode the name of the label that begins the patchpoint: +; CHECK: .Ltmp0: +; CHECK: llilf %r1, 559038736 +; CHECK-NEXT: basr %r14, %r1 +; CHECK-NEXT: bcr 0, %r0 +; CHECK-NEXT: [[PP_END:.L.*]]: +; CHECK: br %r14 + %resolveCall = inttoptr i64 559038736 to i8* + %result = invoke i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 2, i32 10, i8* %resolveCall, i32 1, i64 %p1, i64 %p2) + to label %success unwind label %threw + +success: + ret i64 %result + +threw: + %0 = landingpad { i8*, i32 } + catch i8* null + ret i64 0 +} + +; Verify that the exception table was emitted: +; CHECK: [[EXCEPTION_LABEL]]: +; CHECK-NEXT: .byte 255 +; CHECK-NEXT: .byte 0 +; CHECK-NEXT: .uleb128 .Lttbase{{[0-9]+}}-[[TTBASEREF:.Lttbaseref[0-9]+]] +; CHECK-NEXT: [[TTBASEREF]]: +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .uleb128 .Lcst_end{{[0-9]+}}-[[CST_BEGIN:.Lcst_begin[0-9]+]] +; CHECK-NEXT: [[CST_BEGIN]]: +; Verify that the unwind data covers the entire patchpoint region: +; CHECK-NEXT: .uleb128 .Ltmp0-[[FUNC_BEGIN]] +; CHECK-NEXT: .uleb128 [[PP_END]]-.Ltmp0 + + +; Verify that the stackmap section got emitted: +; CHECK-LABEL: __LLVM_StackMaps: +; Header +; CHECK-NEXT: .byte 3 +; CHECK-NEXT: .byte 0 +; CHECK-NEXT: .short 0 +; Num Functions +; CHECK-NEXT: .long 1 +; Num LargeConstants +; CHECK-NEXT: .long 0 +; Num Callsites +; CHECK-NEXT: .long 1 +; CHECK-NEXT: .quad patchpoint_invoke + + +declare void @llvm.experimental.stackmap(i64, i32, ...) +declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...) +declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...) +declare i32 @__gxx_personality_v0(...) |

