[PATCH] D158623: [RISCV] Reorder the stack frame objects.
Kito Cheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 01:46:09 PDT 2023
kito-cheng added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:545
+ // It's only used to reduce codesize.
+ if (!MF.getFunction().hasMinSize())
+ return;
----------------
wangpc wrote:
> lcvon007 wrote:
> > wangpc wrote:
> > > `hasMinSize()` means that we only enable this optimization in `-Oz`, not in `-Os`. Is this expected?
> > > `hasOptSize()` is for both `-Os` and `-Oz`.
> > Oz is expected and I use RISCVMakeCompressible.cpp as a reference, and do you know when we need to enable it in Os? is it that decreasing codesize much but regress the performace very less? @wangpc
> `Os` is an optimization level for both GCC and LLVM, `Oz` is only for LLVM. For LLVM, `Oz` means extreme code size optimization, and `Os` will consider both code size and performance.
> As for your patch, I think it can be enabled under `Os` since it seems that performance won't be impacted(?).
GCC has Oz as well since GCC 12 :)
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Oz
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