87 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 52# RUN: llc --run-pass=aarch64-ldst-opt %s -o - | FileCheck %s3--- |4 target triple = "aarch64-unknown-linux"5 6 define i32 @f(i32 %x) {7 entry:8 ret i32 09 }10 11 declare i32 @g(i32)12 13...14---15name: f16alignment: 417tracksRegLiveness: true18liveins:19 - { reg: '$w0', virtual-reg: '' }20frameInfo:21 stackSize: 3222 maxAlignment: 823 adjustsStack: true24 hasCalls: true25 isCalleeSavedInfoValid: true26fixedStack: []27stack:28 - { id: 0, name: '', type: spill-slot, offset: -24, size: 8, alignment: 8,29 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,30 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }31 - { id: 1, name: '', type: spill-slot, offset: -32, size: 8, alignment: 8,32 stack-id: default, callee-saved-register: '$fp', callee-saved-restored: true,33 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }34entry_values: []35callSites: []36debugValueSubstitutions: []37constants: []38machineFunctionInfo:39 hasRedZone: false40body: |41 bb.0.entry:42 liveins: $w0, $lr, $x043 ;44 ; Test an SP update is merged forwards into a load instruction,45 ; because an access to the load destination reg prevents merging backwards.46 ;47 ; CHECK-LABEL: name: f48 ; CHECK: liveins: $w0, $lr, $x049 ; CHECK-NEXT: {{ $}}50 ; CHECK-NEXT: $x1 = ADDXri $x0, 1, 051 ; CHECK-NEXT: early-clobber $sp, $x0 = frame-setup LDRXpre $sp, -3252 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 3253 ; CHECK-NEXT: frame-setup STRXui killed $fp, $sp, 0 :: (store (s64) into %stack.1)54 ; CHECK-NEXT: frame-setup STRXui killed $x1, $sp, 155 ; CHECK-NEXT: frame-setup STRXui killed $lr, $sp, 2 :: (store (s64) into %stack.0)56 ; CHECK-NEXT: $fp = frame-setup ADDXri $sp, 0, 057 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $w29, 3258 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w30, -859 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -1660 ; CHECK-NEXT: renamable $w0 = nsw SUBWri killed renamable $w0, 1, 061 ; CHECK-NEXT: BL @g, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w062 ; CHECK-NEXT: $w0 = nsw ADDWri killed renamable $w0, 1, 063 ; CHECK-NEXT: $fp = frame-destroy LDRXui $sp, 0 :: (load (s64) from %stack.1)64 ; CHECK-NEXT: $lr = frame-destroy LDRXui $sp, 2 :: (load (s64) from %stack.0)65 ; CHECK-NEXT: $sp = frame-destroy ADDXri $sp, 32, 066 ; CHECK-NEXT: RET undef $lr, implicit $w067 $sp = frame-setup SUBXri $sp, 32, 068 frame-setup CFI_INSTRUCTION def_cfa_offset 3269 $x1 = ADDXri $x0, 1, 070 $x0 = frame-setup LDRXui $sp, 071 frame-setup STRXui killed $fp, $sp, 0 :: (store (s64) into %stack.1)72 frame-setup STRXui killed $x1, $sp, 173 frame-setup STRXui killed $lr, $sp, 2 :: (store (s64) into %stack.0)74 $fp = frame-setup ADDXri $sp, 0, 075 frame-setup CFI_INSTRUCTION def_cfa $w29, 3276 frame-setup CFI_INSTRUCTION offset $w30, -877 frame-setup CFI_INSTRUCTION offset $w29, -1678 renamable $w0 = nsw SUBWri killed renamable $w0, 1, 079 BL @g, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w080 $w0 = nsw ADDWri killed renamable $w0, 1, 081 $fp = frame-destroy LDRXui $sp, 0 :: (load (s64) from %stack.1)82 $lr = frame-destroy LDRXui $sp, 2 :: (load (s64) from %stack.0)83 $sp = frame-destroy ADDXri $sp, 32, 084 RET undef $lr, implicit $w085 86...87