blob: 0145c6de8924f9dbe247e0df106f208b099521a7 [file]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc -mtriple riscv32-unknown-elf -mattr=+experimental-xsfmclic \
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV32
; RUN: llc -mtriple riscv64-unknown-elf -mattr=+experimental-xsfmclic \
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV64
@size = external global i32
declare void @use(ptr)
define void @preemptible() "interrupt"="SiFive-CLIC-preemptible" "frame-pointer"="all" {
; RV32-LABEL: preemptible:
; RV32: # %bb.0:
; RV32-NEXT: addi sp, sp, -32
; RV32-NEXT: .cfi_def_cfa_offset 32
; RV32-NEXT: sw t0, 16(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 28(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 24(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset s0, -20
; RV32-NEXT: addi s0, sp, 32
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: .cfi_def_cfa sp, 32
; RV32-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 24(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 28(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 16(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: addi sp, sp, 32
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: mret
;
; RV64-LABEL: preemptible:
; RV64: # %bb.0:
; RV64-NEXT: addi sp, sp, -48
; RV64-NEXT: .cfi_def_cfa_offset 48
; RV64-NEXT: sd t0, 16(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 40(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 32(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset s0, -40
; RV64-NEXT: addi s0, sp, 48
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: .cfi_def_cfa sp, 48
; RV64-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 32(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 40(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 16(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: addi sp, sp, 48
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: mret
ret void
}
define void @preemptible_stack_swap() "interrupt"="SiFive-CLIC-preemptible-stack-swap" "frame-pointer"="all" {
; RV32-LABEL: preemptible_stack_swap:
; RV32: # %bb.0:
; RV32-NEXT: csrrw sp, sf.mscratchcsw, sp
; RV32-NEXT: addi sp, sp, -32
; RV32-NEXT: .cfi_def_cfa_offset 32
; RV32-NEXT: sw t0, 16(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 28(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 24(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset s0, -20
; RV32-NEXT: addi s0, sp, 32
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: .cfi_def_cfa sp, 32
; RV32-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 24(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 28(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 16(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: addi sp, sp, 32
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: csrrw sp, sf.mscratchcsw, sp
; RV32-NEXT: mret
;
; RV64-LABEL: preemptible_stack_swap:
; RV64: # %bb.0:
; RV64-NEXT: csrrw sp, sf.mscratchcsw, sp
; RV64-NEXT: addi sp, sp, -48
; RV64-NEXT: .cfi_def_cfa_offset 48
; RV64-NEXT: sd t0, 16(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 40(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 32(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset s0, -40
; RV64-NEXT: addi s0, sp, 48
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: .cfi_def_cfa sp, 48
; RV64-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 32(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 40(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 16(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: addi sp, sp, 48
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: csrrw sp, sf.mscratchcsw, sp
; RV64-NEXT: mret
ret void
}
define void @preemptible_var_alloca() "interrupt"="SiFive-CLIC-preemptible" "frame-pointer"="none" {
; RV32-LABEL: preemptible_var_alloca:
; RV32: # %bb.0:
; RV32-NEXT: addi sp, sp, -80
; RV32-NEXT: .cfi_def_cfa_offset 80
; RV32-NEXT: sw t0, 64(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 76(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 72(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 68(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t1, 60(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t2, 56(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 52(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a0, 48(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a1, 44(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a2, 40(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a3, 36(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a4, 32(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a5, 28(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a6, 24(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a7, 20(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t3, 16(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t4, 12(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t5, 8(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t6, 4(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset t1, -20
; RV32-NEXT: .cfi_offset t2, -24
; RV32-NEXT: .cfi_offset s0, -28
; RV32-NEXT: .cfi_offset a0, -32
; RV32-NEXT: .cfi_offset a1, -36
; RV32-NEXT: .cfi_offset a2, -40
; RV32-NEXT: .cfi_offset a3, -44
; RV32-NEXT: .cfi_offset a4, -48
; RV32-NEXT: .cfi_offset a5, -52
; RV32-NEXT: .cfi_offset a6, -56
; RV32-NEXT: .cfi_offset a7, -60
; RV32-NEXT: .cfi_offset t3, -64
; RV32-NEXT: .cfi_offset t4, -68
; RV32-NEXT: .cfi_offset t5, -72
; RV32-NEXT: .cfi_offset t6, -76
; RV32-NEXT: addi s0, sp, 80
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: lui a0, %hi(size)
; RV32-NEXT: lw a0, %lo(size)(a0)
; RV32-NEXT: addi a0, a0, 15
; RV32-NEXT: andi a0, a0, -16
; RV32-NEXT: sub a0, sp, a0
; RV32-NEXT: mv sp, a0
; RV32-NEXT: call use
; RV32-NEXT: addi sp, s0, -80
; RV32-NEXT: .cfi_def_cfa sp, 80
; RV32-NEXT: lw ra, 68(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t1, 60(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t2, 56(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 52(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a0, 48(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a1, 44(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a2, 40(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a3, 36(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a4, 32(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a5, 28(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a6, 24(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a7, 20(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t3, 16(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t4, 12(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t5, 8(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t6, 4(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 72(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 76(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 64(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore t1
; RV32-NEXT: .cfi_restore t2
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: .cfi_restore a0
; RV32-NEXT: .cfi_restore a1
; RV32-NEXT: .cfi_restore a2
; RV32-NEXT: .cfi_restore a3
; RV32-NEXT: .cfi_restore a4
; RV32-NEXT: .cfi_restore a5
; RV32-NEXT: .cfi_restore a6
; RV32-NEXT: .cfi_restore a7
; RV32-NEXT: .cfi_restore t3
; RV32-NEXT: .cfi_restore t4
; RV32-NEXT: .cfi_restore t5
; RV32-NEXT: .cfi_restore t6
; RV32-NEXT: addi sp, sp, 80
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: mret
;
; RV64-LABEL: preemptible_var_alloca:
; RV64: # %bb.0:
; RV64-NEXT: addi sp, sp, -160
; RV64-NEXT: .cfi_def_cfa_offset 160
; RV64-NEXT: sd t0, 128(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 152(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 144(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 136(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t1, 120(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t2, 112(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 104(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a0, 96(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a1, 88(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a2, 80(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a3, 72(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a4, 64(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a5, 56(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a6, 48(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a7, 40(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t3, 32(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t4, 24(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t5, 16(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t6, 8(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset t1, -40
; RV64-NEXT: .cfi_offset t2, -48
; RV64-NEXT: .cfi_offset s0, -56
; RV64-NEXT: .cfi_offset a0, -64
; RV64-NEXT: .cfi_offset a1, -72
; RV64-NEXT: .cfi_offset a2, -80
; RV64-NEXT: .cfi_offset a3, -88
; RV64-NEXT: .cfi_offset a4, -96
; RV64-NEXT: .cfi_offset a5, -104
; RV64-NEXT: .cfi_offset a6, -112
; RV64-NEXT: .cfi_offset a7, -120
; RV64-NEXT: .cfi_offset t3, -128
; RV64-NEXT: .cfi_offset t4, -136
; RV64-NEXT: .cfi_offset t5, -144
; RV64-NEXT: .cfi_offset t6, -152
; RV64-NEXT: addi s0, sp, 160
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: lui a0, %hi(size)
; RV64-NEXT: lwu a0, %lo(size)(a0)
; RV64-NEXT: addi a0, a0, 15
; RV64-NEXT: andi a0, a0, -16
; RV64-NEXT: sub a0, sp, a0
; RV64-NEXT: mv sp, a0
; RV64-NEXT: call use
; RV64-NEXT: addi sp, s0, -160
; RV64-NEXT: .cfi_def_cfa sp, 160
; RV64-NEXT: ld ra, 136(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t1, 120(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t2, 112(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 104(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a0, 96(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a1, 88(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a2, 80(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a3, 72(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a4, 64(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a5, 56(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a6, 48(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a7, 40(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t3, 32(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t4, 24(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t5, 16(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t6, 8(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 144(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 152(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 128(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore t1
; RV64-NEXT: .cfi_restore t2
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: .cfi_restore a0
; RV64-NEXT: .cfi_restore a1
; RV64-NEXT: .cfi_restore a2
; RV64-NEXT: .cfi_restore a3
; RV64-NEXT: .cfi_restore a4
; RV64-NEXT: .cfi_restore a5
; RV64-NEXT: .cfi_restore a6
; RV64-NEXT: .cfi_restore a7
; RV64-NEXT: .cfi_restore t3
; RV64-NEXT: .cfi_restore t4
; RV64-NEXT: .cfi_restore t5
; RV64-NEXT: .cfi_restore t6
; RV64-NEXT: addi sp, sp, 160
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: mret
%count = load volatile i32, ptr @size
%object = alloca i8, i32 %count, align 16
call void @use(ptr %object)
ret void
}
define void @preemptible_realign() "interrupt"="SiFive-CLIC-preemptible" "frame-pointer"="none" {
; RV32-LABEL: preemptible_realign:
; RV32: # %bb.0:
; RV32-NEXT: addi sp, sp, -192
; RV32-NEXT: .cfi_def_cfa_offset 192
; RV32-NEXT: sw t0, 176(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 188(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 184(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 180(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t1, 172(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t2, 168(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 164(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a0, 160(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a1, 156(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a2, 152(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a3, 148(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a4, 144(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a5, 140(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a6, 136(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a7, 132(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t3, 128(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t4, 124(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t5, 120(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t6, 116(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset t1, -20
; RV32-NEXT: .cfi_offset t2, -24
; RV32-NEXT: .cfi_offset s0, -28
; RV32-NEXT: .cfi_offset a0, -32
; RV32-NEXT: .cfi_offset a1, -36
; RV32-NEXT: .cfi_offset a2, -40
; RV32-NEXT: .cfi_offset a3, -44
; RV32-NEXT: .cfi_offset a4, -48
; RV32-NEXT: .cfi_offset a5, -52
; RV32-NEXT: .cfi_offset a6, -56
; RV32-NEXT: .cfi_offset a7, -60
; RV32-NEXT: .cfi_offset t3, -64
; RV32-NEXT: .cfi_offset t4, -68
; RV32-NEXT: .cfi_offset t5, -72
; RV32-NEXT: .cfi_offset t6, -76
; RV32-NEXT: addi s0, sp, 192
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: andi sp, sp, -64
; RV32-NEXT: mv a0, sp
; RV32-NEXT: call use
; RV32-NEXT: addi sp, s0, -192
; RV32-NEXT: .cfi_def_cfa sp, 192
; RV32-NEXT: lw ra, 180(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t1, 172(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t2, 168(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 164(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a0, 160(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a1, 156(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a2, 152(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a3, 148(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a4, 144(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a5, 140(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a6, 136(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a7, 132(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t3, 128(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t4, 124(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t5, 120(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t6, 116(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 184(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 188(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 176(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore t1
; RV32-NEXT: .cfi_restore t2
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: .cfi_restore a0
; RV32-NEXT: .cfi_restore a1
; RV32-NEXT: .cfi_restore a2
; RV32-NEXT: .cfi_restore a3
; RV32-NEXT: .cfi_restore a4
; RV32-NEXT: .cfi_restore a5
; RV32-NEXT: .cfi_restore a6
; RV32-NEXT: .cfi_restore a7
; RV32-NEXT: .cfi_restore t3
; RV32-NEXT: .cfi_restore t4
; RV32-NEXT: .cfi_restore t5
; RV32-NEXT: .cfi_restore t6
; RV32-NEXT: addi sp, sp, 192
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: mret
;
; RV64-LABEL: preemptible_realign:
; RV64: # %bb.0:
; RV64-NEXT: addi sp, sp, -256
; RV64-NEXT: .cfi_def_cfa_offset 256
; RV64-NEXT: sd t0, 224(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 248(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 240(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 232(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t1, 216(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t2, 208(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 200(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a0, 192(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a1, 184(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a2, 176(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a3, 168(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a4, 160(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a5, 152(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a6, 144(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a7, 136(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t3, 128(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t4, 120(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t5, 112(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t6, 104(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset t1, -40
; RV64-NEXT: .cfi_offset t2, -48
; RV64-NEXT: .cfi_offset s0, -56
; RV64-NEXT: .cfi_offset a0, -64
; RV64-NEXT: .cfi_offset a1, -72
; RV64-NEXT: .cfi_offset a2, -80
; RV64-NEXT: .cfi_offset a3, -88
; RV64-NEXT: .cfi_offset a4, -96
; RV64-NEXT: .cfi_offset a5, -104
; RV64-NEXT: .cfi_offset a6, -112
; RV64-NEXT: .cfi_offset a7, -120
; RV64-NEXT: .cfi_offset t3, -128
; RV64-NEXT: .cfi_offset t4, -136
; RV64-NEXT: .cfi_offset t5, -144
; RV64-NEXT: .cfi_offset t6, -152
; RV64-NEXT: addi s0, sp, 256
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: andi sp, sp, -64
; RV64-NEXT: mv a0, sp
; RV64-NEXT: call use
; RV64-NEXT: addi sp, s0, -256
; RV64-NEXT: .cfi_def_cfa sp, 256
; RV64-NEXT: ld ra, 232(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t1, 216(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t2, 208(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 200(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a0, 192(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a1, 184(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a2, 176(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a3, 168(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a4, 160(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a5, 152(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a6, 144(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a7, 136(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t3, 128(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t4, 120(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t5, 112(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t6, 104(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 240(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 248(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 224(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore t1
; RV64-NEXT: .cfi_restore t2
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: .cfi_restore a0
; RV64-NEXT: .cfi_restore a1
; RV64-NEXT: .cfi_restore a2
; RV64-NEXT: .cfi_restore a3
; RV64-NEXT: .cfi_restore a4
; RV64-NEXT: .cfi_restore a5
; RV64-NEXT: .cfi_restore a6
; RV64-NEXT: .cfi_restore a7
; RV64-NEXT: .cfi_restore t3
; RV64-NEXT: .cfi_restore t4
; RV64-NEXT: .cfi_restore t5
; RV64-NEXT: .cfi_restore t6
; RV64-NEXT: addi sp, sp, 256
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: mret
%object = alloca [64 x i8], align 64
call void @use(ptr %object)
ret void
}
define void @large_frame_fp() "interrupt"="SiFive-CLIC-preemptible" "frame-pointer"="all" {
; RV32-LABEL: large_frame_fp:
; RV32: # %bb.0:
; RV32-NEXT: addi sp, sp, -2032
; RV32-NEXT: .cfi_def_cfa_offset 2032
; RV32-NEXT: sw t0, 2016(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 2028(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 2024(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 2020(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t1, 2012(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t2, 2008(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 2004(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a0, 2000(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a1, 1996(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a2, 1992(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a3, 1988(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a4, 1984(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a5, 1980(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a6, 1976(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a7, 1972(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t3, 1968(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t4, 1964(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t5, 1960(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t6, 1956(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset t1, -20
; RV32-NEXT: .cfi_offset t2, -24
; RV32-NEXT: .cfi_offset s0, -28
; RV32-NEXT: .cfi_offset a0, -32
; RV32-NEXT: .cfi_offset a1, -36
; RV32-NEXT: .cfi_offset a2, -40
; RV32-NEXT: .cfi_offset a3, -44
; RV32-NEXT: .cfi_offset a4, -48
; RV32-NEXT: .cfi_offset a5, -52
; RV32-NEXT: .cfi_offset a6, -56
; RV32-NEXT: .cfi_offset a7, -60
; RV32-NEXT: .cfi_offset t3, -64
; RV32-NEXT: .cfi_offset t4, -68
; RV32-NEXT: .cfi_offset t5, -72
; RV32-NEXT: .cfi_offset t6, -76
; RV32-NEXT: addi s0, sp, 2032
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: addi sp, sp, -2048
; RV32-NEXT: addi sp, sp, -96
; RV32-NEXT: mv a0, sp
; RV32-NEXT: call use
; RV32-NEXT: addi sp, sp, 2032
; RV32-NEXT: addi sp, sp, 112
; RV32-NEXT: .cfi_def_cfa sp, 2032
; RV32-NEXT: lw ra, 2020(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t1, 2012(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t2, 2008(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 2004(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a0, 2000(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a1, 1996(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a2, 1992(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a3, 1988(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a4, 1984(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a5, 1980(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a6, 1976(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a7, 1972(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t3, 1968(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t4, 1964(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t5, 1960(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t6, 1956(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 2024(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 2028(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 2016(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore t1
; RV32-NEXT: .cfi_restore t2
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: .cfi_restore a0
; RV32-NEXT: .cfi_restore a1
; RV32-NEXT: .cfi_restore a2
; RV32-NEXT: .cfi_restore a3
; RV32-NEXT: .cfi_restore a4
; RV32-NEXT: .cfi_restore a5
; RV32-NEXT: .cfi_restore a6
; RV32-NEXT: .cfi_restore a7
; RV32-NEXT: .cfi_restore t3
; RV32-NEXT: .cfi_restore t4
; RV32-NEXT: .cfi_restore t5
; RV32-NEXT: .cfi_restore t6
; RV32-NEXT: addi sp, sp, 2032
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: mret
;
; RV64-LABEL: large_frame_fp:
; RV64: # %bb.0:
; RV64-NEXT: addi sp, sp, -2032
; RV64-NEXT: .cfi_def_cfa_offset 2032
; RV64-NEXT: sd t0, 2000(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 2024(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 2016(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 2008(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t1, 1992(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t2, 1984(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 1976(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a0, 1968(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a1, 1960(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a2, 1952(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a3, 1944(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a4, 1936(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a5, 1928(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a6, 1920(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a7, 1912(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t3, 1904(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t4, 1896(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t5, 1888(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t6, 1880(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset t1, -40
; RV64-NEXT: .cfi_offset t2, -48
; RV64-NEXT: .cfi_offset s0, -56
; RV64-NEXT: .cfi_offset a0, -64
; RV64-NEXT: .cfi_offset a1, -72
; RV64-NEXT: .cfi_offset a2, -80
; RV64-NEXT: .cfi_offset a3, -88
; RV64-NEXT: .cfi_offset a4, -96
; RV64-NEXT: .cfi_offset a5, -104
; RV64-NEXT: .cfi_offset a6, -112
; RV64-NEXT: .cfi_offset a7, -120
; RV64-NEXT: .cfi_offset t3, -128
; RV64-NEXT: .cfi_offset t4, -136
; RV64-NEXT: .cfi_offset t5, -144
; RV64-NEXT: .cfi_offset t6, -152
; RV64-NEXT: addi s0, sp, 2032
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: addi sp, sp, -2048
; RV64-NEXT: addi sp, sp, -176
; RV64-NEXT: mv a0, sp
; RV64-NEXT: call use
; RV64-NEXT: addi sp, sp, 2032
; RV64-NEXT: addi sp, sp, 192
; RV64-NEXT: .cfi_def_cfa sp, 2032
; RV64-NEXT: ld ra, 2008(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t1, 1992(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t2, 1984(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 1976(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a0, 1968(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a1, 1960(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a2, 1952(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a3, 1944(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a4, 1936(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a5, 1928(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a6, 1920(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a7, 1912(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t3, 1904(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t4, 1896(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t5, 1888(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t6, 1880(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 2016(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 2024(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 2000(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore t1
; RV64-NEXT: .cfi_restore t2
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: .cfi_restore a0
; RV64-NEXT: .cfi_restore a1
; RV64-NEXT: .cfi_restore a2
; RV64-NEXT: .cfi_restore a3
; RV64-NEXT: .cfi_restore a4
; RV64-NEXT: .cfi_restore a5
; RV64-NEXT: .cfi_restore a6
; RV64-NEXT: .cfi_restore a7
; RV64-NEXT: .cfi_restore t3
; RV64-NEXT: .cfi_restore t4
; RV64-NEXT: .cfi_restore t5
; RV64-NEXT: .cfi_restore t6
; RV64-NEXT: addi sp, sp, 2032
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: mret
%object = alloca [4096 x i8], align 16
call void @use(ptr %object)
ret void
}
define void @realign_var_alloca() "interrupt"="SiFive-CLIC-preemptible" "frame-pointer"="none" {
; RV32-LABEL: realign_var_alloca:
; RV32: # %bb.0:
; RV32-NEXT: addi sp, sp, -128
; RV32-NEXT: .cfi_def_cfa_offset 128
; RV32-NEXT: sw t0, 112(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset t0, -16
; RV32-NEXT: csrr t0, mcause
; RV32-NEXT: sw t0, 124(sp) # 4-byte Folded Spill
; RV32-NEXT: csrr t0, mepc
; RV32-NEXT: csrsi mstatus, 8
; RV32-NEXT: sw t0, 120(sp) # 4-byte Folded Spill
; RV32-NEXT: sw ra, 116(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t1, 108(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t2, 104(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s0, 100(sp) # 4-byte Folded Spill
; RV32-NEXT: sw s1, 96(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a0, 92(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a1, 88(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a2, 84(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a3, 80(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a4, 76(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a5, 72(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a6, 68(sp) # 4-byte Folded Spill
; RV32-NEXT: sw a7, 64(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t3, 60(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t4, 56(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t5, 52(sp) # 4-byte Folded Spill
; RV32-NEXT: sw t6, 48(sp) # 4-byte Folded Spill
; RV32-NEXT: .cfi_offset ra, -12
; RV32-NEXT: .cfi_offset t1, -20
; RV32-NEXT: .cfi_offset t2, -24
; RV32-NEXT: .cfi_offset s0, -28
; RV32-NEXT: .cfi_offset s1, -32
; RV32-NEXT: .cfi_offset a0, -36
; RV32-NEXT: .cfi_offset a1, -40
; RV32-NEXT: .cfi_offset a2, -44
; RV32-NEXT: .cfi_offset a3, -48
; RV32-NEXT: .cfi_offset a4, -52
; RV32-NEXT: .cfi_offset a5, -56
; RV32-NEXT: .cfi_offset a6, -60
; RV32-NEXT: .cfi_offset a7, -64
; RV32-NEXT: .cfi_offset t3, -68
; RV32-NEXT: .cfi_offset t4, -72
; RV32-NEXT: .cfi_offset t5, -76
; RV32-NEXT: .cfi_offset t6, -80
; RV32-NEXT: addi s0, sp, 128
; RV32-NEXT: .cfi_def_cfa s0, 0
; RV32-NEXT: andi sp, sp, -64
; RV32-NEXT: mv s1, sp
; RV32-NEXT: lui a0, %hi(size)
; RV32-NEXT: lw a0, %lo(size)(a0)
; RV32-NEXT: addi a0, a0, 15
; RV32-NEXT: andi a0, a0, -16
; RV32-NEXT: sub a0, sp, a0
; RV32-NEXT: andi a0, a0, -64
; RV32-NEXT: mv sp, a0
; RV32-NEXT: call use
; RV32-NEXT: addi sp, s0, -128
; RV32-NEXT: .cfi_def_cfa sp, 128
; RV32-NEXT: lw ra, 116(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t1, 108(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t2, 104(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s0, 100(sp) # 4-byte Folded Reload
; RV32-NEXT: lw s1, 96(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a0, 92(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a1, 88(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a2, 84(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a3, 80(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a4, 76(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a5, 72(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a6, 68(sp) # 4-byte Folded Reload
; RV32-NEXT: lw a7, 64(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t3, 60(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t4, 56(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t5, 52(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t6, 48(sp) # 4-byte Folded Reload
; RV32-NEXT: lw t0, 120(sp) # 4-byte Folded Reload
; RV32-NEXT: csrci mstatus, 8
; RV32-NEXT: csrw mepc, t0
; RV32-NEXT: lw t0, 124(sp) # 4-byte Folded Reload
; RV32-NEXT: csrw mcause, t0
; RV32-NEXT: lw t0, 112(sp) # 4-byte Folded Reload
; RV32-NEXT: .cfi_restore t0
; RV32-NEXT: .cfi_restore ra
; RV32-NEXT: .cfi_restore t1
; RV32-NEXT: .cfi_restore t2
; RV32-NEXT: .cfi_restore s0
; RV32-NEXT: .cfi_restore s1
; RV32-NEXT: .cfi_restore a0
; RV32-NEXT: .cfi_restore a1
; RV32-NEXT: .cfi_restore a2
; RV32-NEXT: .cfi_restore a3
; RV32-NEXT: .cfi_restore a4
; RV32-NEXT: .cfi_restore a5
; RV32-NEXT: .cfi_restore a6
; RV32-NEXT: .cfi_restore a7
; RV32-NEXT: .cfi_restore t3
; RV32-NEXT: .cfi_restore t4
; RV32-NEXT: .cfi_restore t5
; RV32-NEXT: .cfi_restore t6
; RV32-NEXT: addi sp, sp, 128
; RV32-NEXT: .cfi_def_cfa_offset 0
; RV32-NEXT: mret
;
; RV64-LABEL: realign_var_alloca:
; RV64: # %bb.0:
; RV64-NEXT: addi sp, sp, -192
; RV64-NEXT: .cfi_def_cfa_offset 192
; RV64-NEXT: sd t0, 160(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset t0, -32
; RV64-NEXT: csrr t0, mcause
; RV64-NEXT: sd t0, 184(sp) # 8-byte Folded Spill
; RV64-NEXT: csrr t0, mepc
; RV64-NEXT: csrsi mstatus, 8
; RV64-NEXT: sd t0, 176(sp) # 8-byte Folded Spill
; RV64-NEXT: sd ra, 168(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t1, 152(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t2, 144(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s0, 136(sp) # 8-byte Folded Spill
; RV64-NEXT: sd s1, 128(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a0, 120(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a1, 112(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a2, 104(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a3, 96(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a4, 88(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a5, 80(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a6, 72(sp) # 8-byte Folded Spill
; RV64-NEXT: sd a7, 64(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t3, 56(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t4, 48(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t5, 40(sp) # 8-byte Folded Spill
; RV64-NEXT: sd t6, 32(sp) # 8-byte Folded Spill
; RV64-NEXT: .cfi_offset ra, -24
; RV64-NEXT: .cfi_offset t1, -40
; RV64-NEXT: .cfi_offset t2, -48
; RV64-NEXT: .cfi_offset s0, -56
; RV64-NEXT: .cfi_offset s1, -64
; RV64-NEXT: .cfi_offset a0, -72
; RV64-NEXT: .cfi_offset a1, -80
; RV64-NEXT: .cfi_offset a2, -88
; RV64-NEXT: .cfi_offset a3, -96
; RV64-NEXT: .cfi_offset a4, -104
; RV64-NEXT: .cfi_offset a5, -112
; RV64-NEXT: .cfi_offset a6, -120
; RV64-NEXT: .cfi_offset a7, -128
; RV64-NEXT: .cfi_offset t3, -136
; RV64-NEXT: .cfi_offset t4, -144
; RV64-NEXT: .cfi_offset t5, -152
; RV64-NEXT: .cfi_offset t6, -160
; RV64-NEXT: addi s0, sp, 192
; RV64-NEXT: .cfi_def_cfa s0, 0
; RV64-NEXT: andi sp, sp, -64
; RV64-NEXT: mv s1, sp
; RV64-NEXT: lui a0, %hi(size)
; RV64-NEXT: lwu a0, %lo(size)(a0)
; RV64-NEXT: addi a0, a0, 15
; RV64-NEXT: andi a0, a0, -16
; RV64-NEXT: sub a0, sp, a0
; RV64-NEXT: andi a0, a0, -64
; RV64-NEXT: mv sp, a0
; RV64-NEXT: call use
; RV64-NEXT: addi sp, s0, -192
; RV64-NEXT: .cfi_def_cfa sp, 192
; RV64-NEXT: ld ra, 168(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t1, 152(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t2, 144(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s0, 136(sp) # 8-byte Folded Reload
; RV64-NEXT: ld s1, 128(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a0, 120(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a1, 112(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a2, 104(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a3, 96(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a4, 88(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a5, 80(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a6, 72(sp) # 8-byte Folded Reload
; RV64-NEXT: ld a7, 64(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t3, 56(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t4, 48(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t5, 40(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t6, 32(sp) # 8-byte Folded Reload
; RV64-NEXT: ld t0, 176(sp) # 8-byte Folded Reload
; RV64-NEXT: csrci mstatus, 8
; RV64-NEXT: csrw mepc, t0
; RV64-NEXT: ld t0, 184(sp) # 8-byte Folded Reload
; RV64-NEXT: csrw mcause, t0
; RV64-NEXT: ld t0, 160(sp) # 8-byte Folded Reload
; RV64-NEXT: .cfi_restore t0
; RV64-NEXT: .cfi_restore ra
; RV64-NEXT: .cfi_restore t1
; RV64-NEXT: .cfi_restore t2
; RV64-NEXT: .cfi_restore s0
; RV64-NEXT: .cfi_restore s1
; RV64-NEXT: .cfi_restore a0
; RV64-NEXT: .cfi_restore a1
; RV64-NEXT: .cfi_restore a2
; RV64-NEXT: .cfi_restore a3
; RV64-NEXT: .cfi_restore a4
; RV64-NEXT: .cfi_restore a5
; RV64-NEXT: .cfi_restore a6
; RV64-NEXT: .cfi_restore a7
; RV64-NEXT: .cfi_restore t3
; RV64-NEXT: .cfi_restore t4
; RV64-NEXT: .cfi_restore t5
; RV64-NEXT: .cfi_restore t6
; RV64-NEXT: addi sp, sp, 192
; RV64-NEXT: .cfi_def_cfa_offset 0
; RV64-NEXT: mret
%count = load volatile i32, ptr @size
%object = alloca i8, i32 %count, align 64
call void @use(ptr %object)
ret void
}