1 # RUN: llc -o - %s -mtriple=aarch64-windows -run-pass=aarch64-ldst-opt \
4 # CHECK: $x0 = LDRXui $sp, 1
5 # CHECK: $x19 = frame-destroy LDRXui $sp, 2
8 target triple = "aarch64-pc-windows-gnu"
10 define dso_local noundef i64 @_Z1fPFvPxEx(ptr nocapture noundef readonly %g, i64 noundef %x) uwtable {
12 %x.addr = alloca i64, align 8
13 store i64 %x, ptr %x.addr, align 8
14 call void %g(ptr noundef nonnull %x.addr)
15 call void asm sideeffect "", "~{x19}"()
16 %0 = load i64, ptr %x.addr, align 8
23 exposesReturnsTwice: false
25 regBankSelected: false
28 tracksRegLiveness: true
31 callsUnwindInit: false
35 failsVerification: false
36 tracksDebugUserValues: true
39 - { reg: '$x0', virtual-reg: '' }
40 - { reg: '$x1', virtual-reg: '' }
42 isFrameAddressTaken: false
43 isReturnAddressTaken: false
54 cvBytesOfCalleeSavedRegisters: 0
55 hasOpaqueSPAdjustment: false
57 hasMustTailInVarArgFunc: false
64 - { id: 0, name: x.addr, type: default, offset: -24, size: 8, alignment: 8,
65 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
66 local-offset: -8, debug-info-variable: '', debug-info-expression: '',
67 debug-info-location: '' }
68 - { id: 1, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
69 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
70 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
71 - { id: 2, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
72 stack-id: default, callee-saved-register: '$x19', callee-saved-restored: true,
73 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
75 debugValueSubstitutions: []
81 liveins: $x0, $x1, $x19, $lr
83 $sp = frame-setup SUBXri $sp, 32, 0
84 frame-setup SEH_StackAlloc 32
85 frame-setup STRXui killed $x19, $sp, 2 :: (store (s64) into %stack.2)
86 frame-setup SEH_SaveReg 19, 16
87 frame-setup STRXui killed $lr, $sp, 3 :: (store (s64) into %stack.1)
88 frame-setup SEH_SaveReg 30, 24
89 frame-setup SEH_PrologEnd
90 renamable $x8 = COPY $x0
91 STRXui killed renamable $x1, $sp, 1 :: (store (s64) into %ir.x.addr)
92 $x0 = ADDXri $sp, 8, 0
93 BLR killed renamable $x8, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
94 INLINEASM &"", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def dead early-clobber $x19
95 renamable $x0 = LDRXui $sp, 1 :: (dereferenceable load (s64) from %ir.x.addr)
96 frame-destroy SEH_EpilogStart
97 $lr = frame-destroy LDRXui $sp, 3 :: (load (s64) from %stack.1)
98 frame-destroy SEH_SaveReg 30, 24
99 $x19 = frame-destroy LDRXui $sp, 2 :: (load (s64) from %stack.2)
100 frame-destroy SEH_SaveReg 19, 16
101 $sp = frame-destroy ADDXri $sp, 32, 0
102 frame-destroy SEH_StackAlloc 32
103 frame-destroy SEH_EpilogEnd
104 RET_ReallyLR implicit $x0