1 # NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 # RUN: llc -mtriple riscv64 -mattr=+m,+v -target-abi=lp64 -start-before=prologepilog -o - \
3 # RUN: -verify-machineinstrs %s | FileCheck %s
5 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
6 target triple = "riscv64"
8 define void @spillslot() {
9 ; CHECK-LABEL: spillslot:
11 ; CHECK-NEXT: addi sp, sp, -2032
12 ; CHECK-NEXT: .cfi_def_cfa_offset 2032
13 ; CHECK-NEXT: sd ra, 2024(sp) # 8-byte Folded Spill
14 ; CHECK-NEXT: sd s0, 2016(sp) # 8-byte Folded Spill
15 ; CHECK-NEXT: .cfi_offset ra, -8
16 ; CHECK-NEXT: .cfi_offset s0, -16
17 ; CHECK-NEXT: addi s0, sp, 2032
18 ; CHECK-NEXT: .cfi_def_cfa s0, 0
19 ; CHECK-NEXT: addi sp, sp, -272
20 ; CHECK-NEXT: sd a0, 8(sp)
21 ; CHECK-NEXT: csrr a0, vlenb
22 ; CHECK-NEXT: sd a1, 0(sp)
23 ; CHECK-NEXT: li a1, 3
24 ; CHECK-NEXT: slli a1, a1, 10
25 ; CHECK-NEXT: mul a0, a0, a1
26 ; CHECK-NEXT: ld a1, 0(sp)
27 ; CHECK-NEXT: sub sp, sp, a0
28 ; CHECK-NEXT: ld a0, 8(sp)
29 ; CHECK-NEXT: andi sp, sp, -128
30 ; CHECK-NEXT: sd a0, 8(sp)
31 ; CHECK-NEXT: addi a0, sp, 2047
32 ; CHECK-NEXT: addi a0, a0, 241
33 ; CHECK-NEXT: vs1r.v v25, (a0) # Unknown-size Folded Spill
34 ; CHECK-NEXT: ld a0, 8(sp)
35 ; CHECK-NEXT: call spillslot
36 ; CHECK-NEXT: addi sp, s0, -2048
37 ; CHECK-NEXT: addi sp, sp, -256
38 ; CHECK-NEXT: addi sp, sp, 272
39 ; CHECK-NEXT: ld ra, 2024(sp) # 8-byte Folded Reload
40 ; CHECK-NEXT: ld s0, 2016(sp) # 8-byte Folded Reload
41 ; CHECK-NEXT: addi sp, sp, 2032
50 tracksRegLiveness: false
52 isFrameAddressTaken: false
53 isReturnAddressTaken: false
62 maxCallFrameSize: 4294967295
63 cvBytesOfCalleeSavedRegisters: 0
64 hasOpaqueSPAdjustment: false
66 hasMustTailInVarArgFunc: false
73 - { id: 0, name: '', type: default, offset: 0, size: 2048, alignment: 128,
74 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
75 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
76 - { id: 1, name: '', type: spill-slot, offset: 0, size: 24576, alignment: 8,
77 stack-id: scalable-vector, callee-saved-register: '', callee-saved-restored: true,
78 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
81 liveins: $x1, $x5, $x6, $x7, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x28, $x29, $x30, $x31, $v25
83 VS1R_V killed renamable $v25, %stack.1 :: (store unknown-size into %stack.1, align 8)
84 ; This is here just to make all the eligible registers live at this point.
85 ; This way when we replace the frame index %stack.1 with its actual address
86 ; we have to allocate two virtual registers to compute it.
87 ; A later run of the the register scavenger won't find available registers
88 ; either so it will have to spill two to the emergency spill slots
89 ; required for this RVV computation.
90 PseudoCALL target-flags(riscv-call) @spillslot, csr_ilp32_lp64, implicit-def $x1, implicit-def $x2, implicit $x1, implicit $x5, implicit $x6, implicit $x7, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit $x16, implicit $x17, implicit $x28, implicit $x29, implicit $x30, implicit $x31