Enable frame pointer optimization by default to match it with other targets.
This brings a small reduction in generated binary sizes.
Fixes bug #48327 (https://github.com/llvm/llvm-project/issues/48327).
Differential D138532
[SPARC][clang] Enable frame pointer optimization by default koakuma on Nov 22 2022, 4:40 PM. Authored by
Details Enable frame pointer optimization by default to match it with other targets. Fixes bug #48327 (https://github.com/llvm/llvm-project/issues/48327).
Diff Detail
Event TimelineComment Actions
I think we usually follow GCC instead of other targets. I am unfamiliar with sparc. Can you show an example where -fomit-frame-pointer/-fno-omit-frame-pointer demonstrate a codegen difference? I tried some simple examples and cannot reproduce a difference. It's somewhat unfortunate to add 6 RUN lines to test these sparc behaviors... Comment Actions GCC enables it by default too, for example see https://godbolt.org/z/brPMKnM17
Unfortunately on SPARC, due to the register window mechanics this optimization can only be done on leaf functions. Comment Actions LGTM. I still find it strange that by default clang explicitly disables an optimization that's the default for unattributed functions |