1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub --version 3
3 ; RUN: llc -verify-machineinstrs -max-registers-for-gc-values=256 -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
5 ; Verify that FixupStatepointCallerSaved pass uses correct intruction for spilling a register after copyprop
6 define dso_local ptr addrspace(1) @foo(ptr addrspace(1) %arg) gc "statepoint-example" personality ptr null {
8 ; CHECK: .Lfunc_begin0:
9 ; CHECK-NEXT: .cfi_startproc
10 ; CHECK-NEXT: // %bb.0:
11 ; CHECK-NEXT: sub sp, sp, #48
12 ; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
13 ; CHECK-NEXT: .cfi_def_cfa_offset 48
14 ; CHECK-NEXT: .cfi_offset w19, -8
15 ; CHECK-NEXT: .cfi_offset w30, -16
16 ; CHECK-NEXT: ldr q0, [x0]
17 ; CHECK-NEXT: str q0, [sp, #16]
18 ; CHECK-NEXT: str d0, [sp, #8] // 8-byte Folded Spill
19 ; CHECK-NEXT: bl baz // 8-byte Folded Reload
21 ; CHECK-NEXT: ldp x19, x0, [sp, #8] // 8-byte Folded Reload
22 ; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
23 ; CHECK-NEXT: add sp, sp, #48
25 %load = load <2 x ptr addrspace(1)>, ptr addrspace(1) %arg, align 8
26 %extractelement = extractelement <2 x ptr addrspace(1)> %load, i64 0
27 %call = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %extractelement), "gc-live"(<2 x ptr addrspace(1)> %load) ]
28 %relocate = call coldcc <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token %call, i32 0, i32 0)
29 %extractelement2 = extractelement <2 x ptr addrspace(1)> %relocate, i64 0
30 ret ptr addrspace(1) %extractelement2
34 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
35 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
36 declare <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token, i32, i32) #0
38 attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }