[PATCH] D68979: [RISCV] Handle variable sized objects with the stack need to be realigned

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 03:11:58 PDT 2019


shiva0217 created this revision.
shiva0217 added reviewers: asb, lenary, luismarques.
Herald added subscribers: pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, MaskRay, jrtc27, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.

To handle the variable-sized objects with stack alignment, we need another base register(BP) to record the SP value after realignment. So we could reference the local variables after allocating the variable-sized objects by the base register. To avoid the BP value clobbered by a function call, we need to choose a callee saved register as BP. RV32E only has X8 and X9 as callee saved registers and X8 will be used as FP. So X9 will be chosen as the BP register.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68979

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
  llvm/test/CodeGen/RISCV/stack-realignment-unsupported.ll
  llvm/test/CodeGen/RISCV/stack-realignment-with-variable-sized-objects.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68979.224983.patch
Type: text/x-patch
Size: 8072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/c610c17f/attachment-0001.bin>


More information about the llvm-commits mailing list