[PATCH] D158623: [RISCV] Reorder the stack frame objects.
lcvon via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 27 19:57:27 PDT 2023
lcvon007 added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:566
+ // It's only used to reduce codesize.
+ if (!MF.getFunction().hasMinSize())
+ return;
----------------
wangpc wrote:
> It seems we can also reduce stack size? I think we can enable it by default, not only for optsize. Performance should be evaluated.
The use number of ld/st is static, and the running result may be different, so it's not sure whether we can improve the performance. I think it cannot always reduce stack size, such as,
object1: 4B, 4B aligned
object2: 4B, 4B aligned
object3: 8B, 8B aligned
the stack size will increase if the object order is object1 object3 object2.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158623/new/
https://reviews.llvm.org/D158623
More information about the llvm-commits
mailing list