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 3--- | 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" 8 9 declare void @foo() 10 11 define i8 addrspace(1)* @test_one(i8 addrspace(1)* %p) gc "statepoint-example" { 12 entry: 13 %token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(i8 addrspace(1)* %p) ] 14 %p2 = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %token, i32 0, i32 0) ; (%p, %p) 15 ret i8 addrspace(1)* %p2 16 } 17 18 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 immarg, i32 immarg, void ()*, i32 immarg, i32 immarg, ...) 19 20 ; Function Attrs: nounwind readonly 21 declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32 immarg, i32 immarg) #0 22 23 ; Function Attrs: nounwind 24 declare void @llvm.stackprotector(i8*, i8**) #1 25 26 attributes #0 = { nounwind readonly } 27 attributes #1 = { nounwind } 28 29... 30--- 31name: test_one 32alignment: 16 33exposesReturnsTwice: false 34legalized: false 35regBankSelected: false 36selected: false 37failedISel: false 38tracksRegLiveness: true 39hasWinCFI: false 40registers: [] 41liveins: 42 - { reg: '$rdi', virtual-reg: '' } 43frameInfo: 44 isFrameAddressTaken: false 45 isReturnAddressTaken: false 46 hasStackMap: false 47 hasPatchPoint: false 48 stackSize: 0 49 offsetAdjustment: 0 50 maxAlignment: 1 51 adjustsStack: false 52 hasCalls: true 53 stackProtector: '' 54 maxCallFrameSize: 4294967295 55 cvBytesOfCalleeSavedRegisters: 0 56 hasOpaqueSPAdjustment: false 57 hasVAStart: false 58 hasMustTailInVarArgFunc: false 59 localFrameSize: 0 60 savePoint: '' 61 restorePoint: '' 62fixedStack: [] 63stack: [] 64callSites: [] 65constants: [] 66machineFunctionInfo: {} 67body: | 68 bb.0.entry: 69 liveins: $rdi 70 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 8 into %stack.0) 75 ; CHECK: STATEPOINT 0, 0, 0, @foo, 2, 0, 2, 0, 2, 0, 1, 8, %stack.0, 0, 1, 8, %stack.0, 0, csr_64, implicit-def $rsp, implicit-def $ssp :: (load store 8 on %stack.0) 76 ; CHECK: $rdi = MOV64rm %stack.0, 1, $noreg, 0, $noreg :: (load 8 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, killed renamable $rdi, renamable $rdi(tied-def 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 84 RET 0, killed $rax 85 86... 87