1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - %s -fixup-allow-gcptr-in-csr=false -run-pass fixup-statepoint-caller-saved | FileCheck %s
4 ; ModuleID = 'test/CodeGen/X86/statepoint-fixup-call.ll'
5 source_filename = "test/CodeGen/X86/statepoint-fixup-call.ll"
6 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-pc-linux-gnu"
11 define ptr addrspace(1) @test_one(ptr addrspace(1) %p) gc "statepoint-example" {
13 %token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @foo, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) %p) ]
14 %p2 = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %token, i32 0, i32 0) ; (%p, %p)
15 ret ptr addrspace(1) %p2
18 declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...)
20 ; Function Attrs: nounwind readonly
21 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32 immarg, i32 immarg) #0
23 ; Function Attrs: nounwind
24 declare void @llvm.stackprotector(ptr, ptr) #1
26 attributes #0 = { nounwind readonly }
27 attributes #1 = { nounwind }
33 exposesReturnsTwice: false
35 regBankSelected: false
38 tracksRegLiveness: true
42 - { reg: '$rdi', virtual-reg: '' }
44 isFrameAddressTaken: false
45 isReturnAddressTaken: false
54 maxCallFrameSize: 4294967295
55 cvBytesOfCalleeSavedRegisters: 0
56 hasOpaqueSPAdjustment: false
58 hasMustTailInVarArgFunc: false
66 machineFunctionInfo: {}
71 ; CHECK-LABEL: name: test_one
72 ; CHECK: liveins: $rdi
73 ; CHECK: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
74 ; CHECK: MOV64mr %stack.0, 1, $noreg, 0, $noreg, killed $rdi :: (store (s64) into %stack.0)
75 ; CHECK: STATEPOINT 0, 0, 0, @foo, 2, 0, 2, 0, 2, 0, 2, 1, 1, 8, %stack.0, 0, 2, 0, 2, 1, 0, 0, csr_64, implicit-def $rsp, implicit-def $ssp :: (load store (s64) on %stack.0)
76 ; CHECK: $rdi = MOV64rm %stack.0, 1, $noreg, 0, $noreg :: (load (s64) from %stack.0)
77 ; CHECK: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
78 ; CHECK: $rax = COPY killed renamable $rdi
79 ; CHECK: RET 0, killed $rax
80 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
81 renamable $rdi = STATEPOINT 0, 0, 0, @foo, 2, 0, 2, 0, 2, 0, 2, 1, killed renamable $rdi(tied-def 0), 2, 0, 2, 1, 0, 0, csr_64, implicit-def $rsp, implicit-def $ssp
82 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
83 $rax = COPY killed renamable $rdi