brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · caa7497 Raw
75 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc -global-isel=1 -mtriple=riscv32 -o - %s | FileCheck %s --check-prefix=RV323; RUN: llc -global-isel=1 -mtriple=riscv64 -o - %s | FileCheck %s --check-prefix=RV644 5declare void @use_addr(ptr)6 7define void @test_scoped_alloca(i64 %n) {8; RV32-LABEL: test_scoped_alloca:9; RV32:       # %bb.0:10; RV32-NEXT:    addi sp, sp, -1611; RV32-NEXT:    .cfi_def_cfa_offset 1612; RV32-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill13; RV32-NEXT:    sw s0, 8(sp) # 4-byte Folded Spill14; RV32-NEXT:    sw s1, 4(sp) # 4-byte Folded Spill15; RV32-NEXT:    .cfi_offset ra, -416; RV32-NEXT:    .cfi_offset s0, -817; RV32-NEXT:    .cfi_offset s1, -1218; RV32-NEXT:    addi s0, sp, 1619; RV32-NEXT:    .cfi_def_cfa s0, 020; RV32-NEXT:    addi a0, a0, 1521; RV32-NEXT:    andi a0, a0, -1622; RV32-NEXT:    sub a0, sp, a023; RV32-NEXT:    mv s1, sp24; RV32-NEXT:    mv sp, a025; RV32-NEXT:    call use_addr26; RV32-NEXT:    mv sp, s127; RV32-NEXT:    addi sp, s0, -1628; RV32-NEXT:    .cfi_def_cfa sp, 1629; RV32-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload30; RV32-NEXT:    lw s0, 8(sp) # 4-byte Folded Reload31; RV32-NEXT:    lw s1, 4(sp) # 4-byte Folded Reload32; RV32-NEXT:    .cfi_restore ra33; RV32-NEXT:    .cfi_restore s034; RV32-NEXT:    .cfi_restore s135; RV32-NEXT:    addi sp, sp, 1636; RV32-NEXT:    .cfi_def_cfa_offset 037; RV32-NEXT:    ret38;39; RV64-LABEL: test_scoped_alloca:40; RV64:       # %bb.0:41; RV64-NEXT:    addi sp, sp, -3242; RV64-NEXT:    .cfi_def_cfa_offset 3243; RV64-NEXT:    sd ra, 24(sp) # 8-byte Folded Spill44; RV64-NEXT:    sd s0, 16(sp) # 8-byte Folded Spill45; RV64-NEXT:    sd s1, 8(sp) # 8-byte Folded Spill46; RV64-NEXT:    .cfi_offset ra, -847; RV64-NEXT:    .cfi_offset s0, -1648; RV64-NEXT:    .cfi_offset s1, -2449; RV64-NEXT:    addi s0, sp, 3250; RV64-NEXT:    .cfi_def_cfa s0, 051; RV64-NEXT:    addi a0, a0, 1552; RV64-NEXT:    andi a0, a0, -1653; RV64-NEXT:    sub a0, sp, a054; RV64-NEXT:    mv s1, sp55; RV64-NEXT:    mv sp, a056; RV64-NEXT:    call use_addr57; RV64-NEXT:    mv sp, s158; RV64-NEXT:    addi sp, s0, -3259; RV64-NEXT:    .cfi_def_cfa sp, 3260; RV64-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload61; RV64-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload62; RV64-NEXT:    ld s1, 8(sp) # 8-byte Folded Reload63; RV64-NEXT:    .cfi_restore ra64; RV64-NEXT:    .cfi_restore s065; RV64-NEXT:    .cfi_restore s166; RV64-NEXT:    addi sp, sp, 3267; RV64-NEXT:    .cfi_def_cfa_offset 068; RV64-NEXT:    ret69  %sp = call ptr @llvm.stacksave.p0()70  %addr = alloca i8, i64 %n71  call void @use_addr(ptr %addr)72  call void @llvm.stackrestore.p0(ptr %sp)73  ret void74}75