1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -run-pass=prologepilog %s -o - | FileCheck %s
3 # Regression test for a crash when the probing instruction
4 # to replace is last in the block.
6 source_filename = "tt.ll"
7 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
8 target triple = "aarch64-linux"
12 define void @f(ptr %out) #0 {
14 %p = alloca i32, i32 50000, align 4
17 loop: ; preds = %loop, %entry
18 %c = call i1 @g(ptr %p)
19 br i1 %c, label %loop, label %exit
25 attributes #0 = { uwtable "frame-pointer"="none" "probe-stack"="inline-asm" "target-features"="+sve" }
31 exposesReturnsTwice: false
33 regBankSelected: false
36 tracksRegLiveness: true
39 callsUnwindInit: false
45 failsVerification: false
46 tracksDebugUserValues: true
50 isFrameAddressTaken: false
51 isReturnAddressTaken: false
62 cvBytesOfCalleeSavedRegisters: 0
63 hasOpaqueSPAdjustment: false
65 hasMustTailInVarArgFunc: false
67 localFrameSize: 200000
72 - { id: 0, name: p, type: default, offset: 0, size: 200000, alignment: 4,
73 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
74 local-offset: -200000, debug-info-variable: '', debug-info-expression: '',
75 debug-info-location: '' }
78 debugValueSubstitutions: []
80 machineFunctionInfo: {}
82 ; CHECK-LABEL: name: f
84 ; CHECK-NEXT: successors: %bb.3(0x80000000)
85 ; CHECK-NEXT: liveins: $lr, $fp
87 ; CHECK-NEXT: early-clobber $sp = frame-setup STPXpre killed $fp, killed $lr, $sp, -2 :: (store (s64) into %stack.2), (store (s64) into %stack.1)
88 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
89 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w30, -8
90 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w29, -16
91 ; CHECK-NEXT: $x9 = frame-setup SUBXri $sp, 48, 12
92 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $w9, 196624
94 ; CHECK-NEXT: bb.3.entry:
95 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.3(0x40000000)
96 ; CHECK-NEXT: liveins: $x9
98 ; CHECK-NEXT: $sp = frame-setup SUBXri $sp, 1, 12
99 ; CHECK-NEXT: frame-setup STRXui $xzr, $sp, 0
100 ; CHECK-NEXT: $xzr = frame-setup SUBSXrx64 $sp, $x9, 24, implicit-def $nzcv
101 ; CHECK-NEXT: frame-setup Bcc 1, %bb.3, implicit $nzcv
103 ; CHECK-NEXT: bb.4.entry:
104 ; CHECK-NEXT: successors: %bb.1(0x80000000)
106 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_register $wsp
107 ; CHECK-NEXT: $sp = frame-setup SUBXri $sp, 3392, 0
108 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 200016
109 ; CHECK-NEXT: frame-setup STRXui $xzr, $sp, 0
111 ; CHECK-NEXT: bb.1.loop:
112 ; CHECK-NEXT: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
114 ; CHECK-NEXT: $x0 = ADDXri $sp, 0, 0
115 ; CHECK-NEXT: BL @g, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $w0
116 ; CHECK-NEXT: TBNZW killed renamable $w0, 0, %bb.1
117 ; CHECK-NEXT: B %bb.2
119 ; CHECK-NEXT: bb.2.exit:
120 ; CHECK-NEXT: $sp = frame-destroy ADDXri $sp, 48, 12
121 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 3408
122 ; CHECK-NEXT: $sp = frame-destroy ADDXri $sp, 3392, 0
123 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 16
124 ; CHECK-NEXT: early-clobber $sp, $fp, $lr = frame-destroy LDPXpost $sp, 2 :: (load (s64) from %stack.2), (load (s64) from %stack.1)
125 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
126 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w30
127 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $w29
128 ; CHECK-NEXT: RET_ReallyLR
130 successors: %bb.1(0x80000000)
134 successors: %bb.1(0x7c000000), %bb.2(0x04000000)
136 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
137 $x0 = ADDXri %stack.0.p, 0, 0
138 BL @g, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $w0
139 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
140 TBNZW killed renamable $w0, 0, %bb.1