Philip Reames | 2b1084a | 2016-08-31 15:12:17 +0000 | [diff] [blame] | 1 | ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s |
| 2 | ; Check that the "deopt-lowering" function attribute gets transcoded into |
| 3 | ; flags on the resulting statepoint |
| 4 | |
| 5 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 6 | target triple = "x86_64-apple-macosx10.11.0" |
| 7 | |
| 8 | declare void @foo() |
| 9 | declare void @bar() "deopt-lowering"="live-in" |
| 10 | declare void @baz() "deopt-lowering"="live-through" |
| 11 | |
| 12 | define void @test1() gc "statepoint-example" { |
| 13 | ; CHECK-LABEL: @test1( |
| 14 | ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 1, i32 57) |
| 15 | ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @bar, i32 0, i32 2, i32 0, i32 1, i32 42) |
| 16 | ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @baz, i32 0, i32 0, i32 0, i32 1, i32 13) |
| 17 | |
| 18 | entry: |
| 19 | call void @foo() [ "deopt"(i32 57) ] |
| 20 | call void @bar() [ "deopt"(i32 42) ] |
| 21 | call void @baz() [ "deopt"(i32 13) ] |
| 22 | ret void |
| 23 | } |
Anna Thomas | e76d77a | 2016-10-07 20:34:00 +0000 | [diff] [blame] | 24 | |
| 25 | ; add deopt-lowering attribute as part of callsite |
| 26 | define void @test2() gc "statepoint-example" { |
| 27 | ; CHECK-LABEL: @test2( |
| 28 | ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo, i32 0, i32 2, i32 0, i32 1, i32 57) |
| 29 | |
| 30 | entry: |
| 31 | call void @foo() "deopt-lowering"="live-in" [ "deopt"(i32 57) ] |
| 32 | ret void |
| 33 | } |
| 34 | |