2019-02-12 08:12:46 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-06-03 00:36:37 +08:00
|
|
|
; RUN: llc -verify-machineinstrs < %s | FileCheck %s
|
2015-03-27 12:52:48 +08:00
|
|
|
; Check that we can lower a use of an alloca both as a deopt value (where the
|
|
|
|
; exact meaning is up to the consumer of the stackmap) and as an explicit spill
|
2019-02-12 08:12:46 +08:00
|
|
|
; slot used for GC.
|
2015-03-27 12:52:48 +08:00
|
|
|
|
|
|
|
target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-pc-linux-gnu"
|
|
|
|
|
|
|
|
declare zeroext i1 @return_i1()
|
|
|
|
|
2019-02-12 08:12:46 +08:00
|
|
|
; Can we handle an explicit relocation slot (in the form of an alloca) given
|
2015-03-27 12:52:48 +08:00
|
|
|
; to the statepoint?
|
|
|
|
define i32 addrspace(1)* @test(i32 addrspace(1)* %ptr) gc "statepoint-example" {
|
2019-02-12 08:12:46 +08:00
|
|
|
; CHECK-LABEL: test:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: pushq %rax
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; CHECK-NEXT: movq %rdi, (%rsp)
|
|
|
|
; CHECK-NEXT: callq return_i1
|
|
|
|
; CHECK-NEXT: .Ltmp0:
|
|
|
|
; CHECK-NEXT: movq (%rsp), %rax
|
|
|
|
; CHECK-NEXT: popq %rcx
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
|
|
|
; CHECK-NEXT: retq
|
2015-03-27 12:52:48 +08:00
|
|
|
entry:
|
|
|
|
%alloca = alloca i32 addrspace(1)*, align 8
|
|
|
|
store i32 addrspace(1)* %ptr, i32 addrspace(1)** %alloca
|
2015-12-26 15:54:32 +08:00
|
|
|
call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i32 addrspace(1)** %alloca)
|
2015-03-27 12:52:48 +08:00
|
|
|
%rel = load i32 addrspace(1)*, i32 addrspace(1)** %alloca
|
|
|
|
ret i32 addrspace(1)* %rel
|
|
|
|
}
|
|
|
|
|
2019-02-12 08:12:46 +08:00
|
|
|
; Can we handle an alloca as a deopt value?
|
2015-03-27 12:52:48 +08:00
|
|
|
define i32 addrspace(1)* @test2(i32 addrspace(1)* %ptr) gc "statepoint-example" {
|
2019-02-12 08:12:46 +08:00
|
|
|
; CHECK-LABEL: test2:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: pushq %rax
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; CHECK-NEXT: movq %rdi, (%rsp)
|
|
|
|
; CHECK-NEXT: callq return_i1
|
|
|
|
; CHECK-NEXT: .Ltmp1:
|
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
|
|
|
; CHECK-NEXT: popq %rcx
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
|
|
|
; CHECK-NEXT: retq
|
2015-03-27 12:52:48 +08:00
|
|
|
entry:
|
|
|
|
%alloca = alloca i32 addrspace(1)*, align 8
|
|
|
|
store i32 addrspace(1)* %ptr, i32 addrspace(1)** %alloca
|
2015-12-26 15:54:32 +08:00
|
|
|
call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 1, i32 addrspace(1)** %alloca)
|
2015-03-27 12:52:48 +08:00
|
|
|
ret i32 addrspace(1)* null
|
|
|
|
}
|
|
|
|
|
2015-12-26 15:54:32 +08:00
|
|
|
declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
|
2015-03-27 12:52:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
; CHECK-LABEL: .section .llvm_stackmaps
|
|
|
|
; CHECK-NEXT: __LLVM_StackMaps:
|
|
|
|
; Header
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK-NEXT: .byte 3
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK-NEXT: .byte 0
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; Num Functions
|
|
|
|
; CHECK-NEXT: .long 2
|
|
|
|
; Num LargeConstants
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; Num Callsites
|
|
|
|
; CHECK-NEXT: .long 2
|
|
|
|
|
|
|
|
; Functions and stack size
|
|
|
|
; CHECK-NEXT: .quad test
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK-NEXT: .quad test2
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2015-03-27 12:52:48 +08:00
|
|
|
|
|
|
|
; Large Constants
|
|
|
|
; Statepoint ID only
|
2015-05-13 07:52:24 +08:00
|
|
|
; CHECK: .quad 0
|
2015-03-27 12:52:48 +08:00
|
|
|
|
|
|
|
; Callsites
|
|
|
|
; The GC one
|
2016-12-01 07:48:26 +08:00
|
|
|
; CHECK: .long .Ltmp0-test
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
2015-05-13 03:50:19 +08:00
|
|
|
; CHECK: .short 4
|
|
|
|
; SmallConstant (0)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-05-13 03:50:19 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; SmallConstant (0)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 0
|
|
|
|
; SmallConstant (0)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 0
|
2017-11-29 01:15:09 +08:00
|
|
|
; Direct Spill Slot [rsp+0]
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .byte 2
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 7
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .long 0
|
|
|
|
; No Padding or LiveOuts
|
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .short 0
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK: .p2align 3
|
2015-03-27 12:52:48 +08:00
|
|
|
|
|
|
|
; The Deopt one
|
2016-12-01 07:48:26 +08:00
|
|
|
; CHECK: .long .Ltmp1-test2
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
2015-05-13 03:50:19 +08:00
|
|
|
; CHECK: .short 4
|
|
|
|
; SmallConstant (0)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-05-13 03:50:19 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; SmallConstant (0)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 0
|
|
|
|
; SmallConstant (1)
|
|
|
|
; CHECK: .byte 4
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .long 1
|
2017-11-29 01:15:09 +08:00
|
|
|
; Direct Spill Slot [rsp+0]
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .byte 2
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .byte 0
|
|
|
|
; CHECK: .short 8
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .short 7
|
2017-04-28 12:48:42 +08:00
|
|
|
; CHECK: .short 0
|
2015-03-27 12:52:48 +08:00
|
|
|
; CHECK: .long 0
|
|
|
|
|
|
|
|
; No Padding or LiveOuts
|
|
|
|
; CHECK: .short 0
|
|
|
|
; CHECK: .short 0
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK: .p2align 3
|