koakuma added a comment.

In D138532#3945422 <https://reviews.llvm.org/D138532#3945422>, @MaskRay wrote:

> I think we usually follow GCC instead of other targets.

GCC enables it by default too, for example see https://godbolt.org/z/brPMKnM17
(That link also has comparison with clang with 
`-fomit-frame-pointer`/`-fno-omit-frame-pointer`)

> 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.

Unfortunately on SPARC, due to the register window mechanics this optimization 
can only be done on leaf functions.
As for the concrete effects, it skips the `save` and `restore` instructions for 
register window management, which, among other things, does the 
saving/restoring of frame pointers, and changes the return instruction to 
`retl` (aka `jmp %o7+8`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138532

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to