@@ -108,35 +108,39 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
108108;
109109; SPILL-O2-ZCMP-LABEL: foo:
110110; SPILL-O2-ZCMP: # %bb.0:
111- ; SPILL-O2-ZCMP-NEXT: cm.push {ra, s0}, -16
112- ; SPILL-O2-ZCMP-NEXT: .cfi_def_cfa_offset 16
111+ ; SPILL-O2-ZCMP-NEXT: cm.push {ra, s0}, -32
112+ ; SPILL-O2-ZCMP-NEXT: .cfi_def_cfa_offset 32
113113; SPILL-O2-ZCMP-NEXT: .cfi_offset ra, -8
114114; SPILL-O2-ZCMP-NEXT: .cfi_offset s0, -4
115115; SPILL-O2-ZCMP-NEXT: csrr a1, vlenb
116116; SPILL-O2-ZCMP-NEXT: slli a1, a1, 1
117117; SPILL-O2-ZCMP-NEXT: sub sp, sp, a1
118- ; SPILL-O2-ZCMP-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10 , 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 2 * vlenb
118+ ; SPILL-O2-ZCMP-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20 , 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 2 * vlenb
119119; SPILL-O2-ZCMP-NEXT: mv s0, a0
120- ; SPILL-O2-ZCMP-NEXT: vs1r.v v8, (sp) # vscale x 8-byte Folded Spill
120+ ; SPILL-O2-ZCMP-NEXT: addi a1, sp, 16
121+ ; SPILL-O2-ZCMP-NEXT: vs1r.v v8, (a1) # vscale x 8-byte Folded Spill
121122; SPILL-O2-ZCMP-NEXT: vsetvli zero, a0, e64, m1, ta, ma
122123; SPILL-O2-ZCMP-NEXT: vfadd.vv v9, v8, v9
123124; SPILL-O2-ZCMP-NEXT: csrr a0, vlenb
124125; SPILL-O2-ZCMP-NEXT: add a0, a0, sp
126+ ; SPILL-O2-ZCMP-NEXT: addi a0, a0, 16
125127; SPILL-O2-ZCMP-NEXT: vs1r.v v9, (a0) # vscale x 8-byte Folded Spill
126128; SPILL-O2-ZCMP-NEXT: lui a0, %hi(.L.str)
127129; SPILL-O2-ZCMP-NEXT: addi a0, a0, %lo(.L.str)
128130; SPILL-O2-ZCMP-NEXT: call puts
129131; SPILL-O2-ZCMP-NEXT: csrr a0, vlenb
130132; SPILL-O2-ZCMP-NEXT: add a0, a0, sp
133+ ; SPILL-O2-ZCMP-NEXT: addi a0, a0, 16
131134; SPILL-O2-ZCMP-NEXT: vl1r.v v8, (a0) # vscale x 8-byte Folded Reload
132- ; SPILL-O2-ZCMP-NEXT: vl1r.v v9, (sp) # vscale x 8-byte Folded Reload
135+ ; SPILL-O2-ZCMP-NEXT: addi a0, sp, 16
136+ ; SPILL-O2-ZCMP-NEXT: vl1r.v v9, (a0) # vscale x 8-byte Folded Reload
133137; SPILL-O2-ZCMP-NEXT: vsetvli zero, s0, e64, m1, ta, ma
134138; SPILL-O2-ZCMP-NEXT: vfadd.vv v8, v9, v8
135139; SPILL-O2-ZCMP-NEXT: csrr a0, vlenb
136140; SPILL-O2-ZCMP-NEXT: slli a0, a0, 1
137141; SPILL-O2-ZCMP-NEXT: add sp, sp, a0
138- ; SPILL-O2-ZCMP-NEXT: .cfi_def_cfa sp, 16
139- ; SPILL-O2-ZCMP-NEXT: cm.popret {ra, s0}, 16
142+ ; SPILL-O2-ZCMP-NEXT: .cfi_def_cfa sp, 32
143+ ; SPILL-O2-ZCMP-NEXT: cm.popret {ra, s0}, 32
140144;
141145; SPILL-O0-VSETVLI-LABEL: foo:
142146; SPILL-O0-VSETVLI: # %bb.0:
@@ -227,33 +231,37 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
227231;
228232; SPILL-O2-ZCMP-VSETVLI-LABEL: foo:
229233; SPILL-O2-ZCMP-VSETVLI: # %bb.0:
230- ; SPILL-O2-ZCMP-VSETVLI-NEXT: cm.push {ra, s0}, -16
231- ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_def_cfa_offset 16
234+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: cm.push {ra, s0}, -32
235+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_def_cfa_offset 32
232236; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_offset ra, -8
233237; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_offset s0, -4
234238; SPILL-O2-ZCMP-VSETVLI-NEXT: vsetvli a1, zero, e8, m2, ta, ma
235239; SPILL-O2-ZCMP-VSETVLI-NEXT: sub sp, sp, a1
236- ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10 , 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 2 * vlenb
240+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20 , 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 2 * vlenb
237241; SPILL-O2-ZCMP-VSETVLI-NEXT: mv s0, a0
238- ; SPILL-O2-ZCMP-VSETVLI-NEXT: vs1r.v v8, (sp) # vscale x 8-byte Folded Spill
242+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: addi a1, sp, 16
243+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: vs1r.v v8, (a1) # vscale x 8-byte Folded Spill
239244; SPILL-O2-ZCMP-VSETVLI-NEXT: vsetvli zero, a0, e64, m1, ta, ma
240245; SPILL-O2-ZCMP-VSETVLI-NEXT: vfadd.vv v9, v8, v9
241246; SPILL-O2-ZCMP-VSETVLI-NEXT: csrr a0, vlenb
242247; SPILL-O2-ZCMP-VSETVLI-NEXT: add a0, a0, sp
248+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: addi a0, a0, 16
243249; SPILL-O2-ZCMP-VSETVLI-NEXT: vs1r.v v9, (a0) # vscale x 8-byte Folded Spill
244250; SPILL-O2-ZCMP-VSETVLI-NEXT: lui a0, %hi(.L.str)
245251; SPILL-O2-ZCMP-VSETVLI-NEXT: addi a0, a0, %lo(.L.str)
246252; SPILL-O2-ZCMP-VSETVLI-NEXT: call puts
247253; SPILL-O2-ZCMP-VSETVLI-NEXT: csrr a0, vlenb
248254; SPILL-O2-ZCMP-VSETVLI-NEXT: add a0, a0, sp
255+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: addi a0, a0, 16
249256; SPILL-O2-ZCMP-VSETVLI-NEXT: vl1r.v v8, (a0) # vscale x 8-byte Folded Reload
250- ; SPILL-O2-ZCMP-VSETVLI-NEXT: vl1r.v v9, (sp) # vscale x 8-byte Folded Reload
257+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: addi a0, sp, 16
258+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: vl1r.v v9, (a0) # vscale x 8-byte Folded Reload
251259; SPILL-O2-ZCMP-VSETVLI-NEXT: vsetvli zero, s0, e64, m1, ta, ma
252260; SPILL-O2-ZCMP-VSETVLI-NEXT: vfadd.vv v8, v9, v8
253261; SPILL-O2-ZCMP-VSETVLI-NEXT: vsetvli a0, zero, e8, m2, ta, ma
254262; SPILL-O2-ZCMP-VSETVLI-NEXT: add sp, sp, a0
255- ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_def_cfa sp, 16
256- ; SPILL-O2-ZCMP-VSETVLI-NEXT: cm.popret {ra, s0}, 16
263+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: .cfi_def_cfa sp, 32
264+ ; SPILL-O2-ZCMP-VSETVLI-NEXT: cm.popret {ra, s0}, 32
257265{
258266 %x = call <vscale x 1 x double > @llvm.riscv.vfadd.nxv1f64.nxv1f64 (<vscale x 1 x double > undef , <vscale x 1 x double > %a , <vscale x 1 x double > %b , i32 7 , i32 %gvl )
259267 %call = call signext i32 @puts (ptr @.str )
0 commit comments