This introduces entry points to compiler-rt which allow the -msave-restore optimization to be applied to tail calls as well as ordinary calls.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
It was pointed out in the RISC-V LLVM sync-up that these entry points could be in separate sections to allow -gc-sections to remove any unnecessary entry points. This would mitigate the code size penalty for small programs as only the required entry points would be pulled in, however it would require the linker script to behave and not reorder the sections, and would require some changes to ensure that the fallthrough function does not accidentally get collected.
Comment Actions
Jim Wilson's [draft GNU implementation][1] has CFI directives. IIRC we also didn't add them to the non-tail Compiler-RT implementation but it would be good to take this opportunity to add them here.
compiler-rt/lib/builtins/riscv/restore_tailcall.S | ||
---|---|---|
104 | Remove the "/9/8"? |
Maybe update the description to reflect tail call, if it fits.