[PATCH] D158623: [RISCV] Reorder the stack objects.

lcvon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 07:47:57 PDT 2023


lcvon007 created this revision.
lcvon007 added reviewers: wangpc, craig.topper.
Herald added subscribers: jobnoorman, luke, sunshaoce, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
lcvon007 requested review of this revision.
Herald added subscribers: llvm-commits, eopXD, MaskRay.
Herald added a project: LLVM.

The order of stack objects decides the offset size relative to
sp/fp, and shorter offset is more possible to make the related
instructions to be compressed and use less instructions to
build the offset immediate. So it can improve the code size
if we reorder the stack objects using proper cost model.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158623

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/test/CodeGen/RISCV/reorder-frame-objects.mir
  llvm/test/CodeGen/RISCV/stack-inst-compress.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158623.552712.patch
Type: text/x-patch
Size: 36118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230823/3f874edb/attachment.bin>


More information about the llvm-commits mailing list