[PATCH] D146463: [CodeGen][RISCV] Change Shadow Call Stack Register to S11

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 19:13:39 PDT 2023


kito-cheng added a comment.

Sorry for cross post, but I guess some people might not follow closely in discourse (like me :P):

Another proposal from me is using gp as platform register: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/371

Some advantage on taking gp as platform register rather than other GPRs:

- Compiler doesn’t use gp register anywhere for now.
- All assembly files (which conform with current ABI) didn’t use that except the __global_pointer$ initialization code in CRT files.
- The main user is linker, linker will use that to perform linker relaxation, and we already have the command option to tune that off.

Potential issues:

- Loss the code size and performance gain from gp relaxation
  - The most gain from gp relaxation is embedded application, it’s different target audience as SCS, so this should not blocker issues.
  - Android is an example, it’s already disable GP relaxation at all, so we don’t have any loss for this case.
- Will it break any existing platform?
  - Treat gp as platform register is optional, it’s still default use as gp relaxation, so NO breakage on existing platform, but give the freedom of the platform to use gp register as other purpose if they don’t want gp relxation.
  - Added an attribute to let linker to help mixing up different gp usage objects, also linker could check that attribute to make sure gp relaxation is do-able or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146463



More information about the cfe-commits mailing list