[PATCH] D65959: [RISCV] Implement targetHandlesStackFrameRounding to prevent stack over-allocation

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 10:10:48 PDT 2019


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

TargetFrameLowering contains a callback for telling LLVM that a target
will do its own stack frame size rounding. This defaults to `false`.

In the RISC-V backend, we have been doing our own stack frame size rounding,
without overriding this callback. This has been leading to over-allocation,
which this patch aims to mitigate. In almost all cases of aligned objects on the
stack, stack usage has decreased.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65959

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/test/CodeGen/RISCV/calling-conv-ilp32-ilp32f-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-ilp32-ilp32f-ilp32d-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-lp64-lp64f-lp64d-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-lp64.ll
  llvm/test/CodeGen/RISCV/double-calling-conv.ll
  llvm/test/CodeGen/RISCV/stack-realignment.ll
  llvm/test/CodeGen/RISCV/vararg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65959.214177.patch
Type: text/x-patch
Size: 34527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/6ab16670/attachment.bin>


More information about the llvm-commits mailing list