]> granicus.if.org Git - llvm/commit
[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and...
authorShiva Chen <shiva0217@gmail.com>
Fri, 4 Oct 2019 02:00:57 +0000 (02:00 +0000)
committerShiva Chen <shiva0217@gmail.com>
Fri, 4 Oct 2019 02:00:57 +0000 (02:00 +0000)
commit515eefeb33f90d4528bfca03a0392ee6701630cd
treec70096b885738e93c877023d611e00e738de2494
parent42beceb5d45daef6c19d196ef26adbcb0fb0d0ac
[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore

We would like to split the SP adjustment to reduce the instructions in
prologue and epilogue as the following case. In this way, the offset of
the callee saved register could fit in a single store.

    add     sp,sp,-2032
    sw      ra,2028(sp)
    sw      s0,2024(sp)
    sw      s1,2020(sp)
    sw      s3,2012(sp)
    sw      s4,2008(sp)
    add     sp,sp,-64

Differential Revision: https://reviews.llvm.org/D68011

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373688 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/RISCV/RISCVFrameLowering.cpp
lib/Target/RISCV/RISCVFrameLowering.h
test/CodeGen/RISCV/large-stack.ll
test/CodeGen/RISCV/rv64-large-stack.ll
test/CodeGen/RISCV/split-sp-adjust.ll [new file with mode: 0644]
test/CodeGen/RISCV/stack-realignment.ll