[PATCH] D134129: [PATCH] [RISCV] Enable -msave-restore by default when optimizing for size

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 16:16:55 PST 2023


jrtc27 added a comment.

In D134129#4179673 <https://reviews.llvm.org/D134129#4179673>, @MaskRay wrote:

> At least with that this diff shows, the saving is small. I'd hope that we don't toggle -msave-restore for -Os/-Oz. Users can specify -msave-restore themselves.

Well, tiny tests like this aren't representative of real-world code, so I don't think it's fair to base it off this. Don't know what the figures are for real-world code.



================
Comment at: llvm/test/CodeGen/RISCV/saverestore.ll:43-72
+define void @callee_saved0_z() nounwind #0 {
+; RV32I-LABEL: callee_saved0_z:
+; RV32I:     call t0, __riscv_save_5
+; RV32I:     tail __riscv_restore_5
+;
+; RV64I-LABEL: callee_saved0_z:
+; RV64I:     call t0, __riscv_save_5
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134129/new/

https://reviews.llvm.org/D134129



More information about the llvm-commits mailing list