[PATCH] D89237: [RISCV] Do not grow the stack a second time when we need to realign the stack

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 07:09:41 PDT 2020


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

This is a first change needed to fix a crash in which the emergency spill splot ends being out of reach. This happens when we run the register scavenger after we have eliminated the frame indexes. The fix for the actual crash will come in a later change.

This change removes an extra stack size increase we do in `RISCVFrameLowering::determineFrameLayout`.

My understanding is that we don't have to change the size of the stack here as `PEI::calculateFrameObjectOffsets` is already doing this (see https://github.com/llvm/llvm-project/blob/539381da26096df54ccf862088c8242498a7dcae/llvm/lib/CodeGen/PrologEpilogInserter.cpp#L1085 ) with the right size accounting the extra alignment as kept in `MaxAlign` (see https://github.com/llvm/llvm-project/blob/539381da26096df54ccf862088c8242498a7dcae/llvm/lib/CodeGen/PrologEpilogInserter.cpp#L1079 ).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89237

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89237.297576.patch
Type: text/x-patch
Size: 16576 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201012/87cab78b/attachment.bin>


More information about the llvm-commits mailing list