[PATCH] D159431: [RISCV] adjust first sp size to use c.addi16sp.

lcvon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 06:26:21 PDT 2023


lcvon007 created this revision.
lcvon007 added reviewers: craig.topper, reames, wangpc.
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.

addi sp, sp, 512 may be used to recover the sp in the epilogue
when stack size is larger than 2047(2^11 - 1), however, it can
not be compressed using C extension, and addi sp, sp, 496 is
able to be compressed, so try to use 496 as the ajust amount of
the fisrt sp if function doesn't need extra instructions after
adjust.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159431

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159431.555731.patch
Type: text/x-patch
Size: 7772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230904/1dc2c779/attachment-0001.bin>


More information about the llvm-commits mailing list