[PATCH] D62007: [RISCV][WIP] Minimal stack realignment support

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 06:49:29 PDT 2019


asb created this revision.
Herald added subscribers: llvm-commits, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.

Currently the RISC-V backend won't realign the stack. This can be an issue even for the RV32I/RV64I ABIs (where the stack is 16-byte aligned), though is rare. It will be much more comment with RV32E (though the alignment requirements for common data types remain under-documented...). This patch adds minimal support for stack realignment. It will error out if the stack needs realignment and variable sized objects are present.

Sharing as an early WIP. Barely tested so may have issues. It feels like a lot of the code like getFrameIndexReference and determineFrameLayout could be refactored somehow, as right now it feels fiddly and brittle.


https://reviews.llvm.org/D62007

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/test/CodeGen/RISCV/stack-realignment-unsupported.ll
  llvm/test/CodeGen/RISCV/stack-realignment.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62007.199813.patch
Type: text/x-patch
Size: 5501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190516/f741fa26/attachment.bin>


More information about the llvm-commits mailing list