For a description of the riscv-overlay system proposal: https://github.com/riscv-software-src/riscv-overlay/
This is the Clang component of a change to add support for a proposed 'overlay' system for RISC-V to LLVM.
This adds two new attributes, attribute((overlaydata)), and attribute((overlaycall)), which are used to mark functions or global data as only accessible through the overlay engine. Internally they are converted to 'overlay-data' and 'overlay-call' attributes in LLVM IR.
This change also adds the option -fcomrv to enable use of the overlay system. This has the effect of reserving registers x28, x29, x30 and x31 for exclusive used by the overlay engine.
I thought the idea for this proposal was to come up with something that wasn't RISC-V specific (an architecture-independent specification and a RISC-V-specific supplement for how that is mapped to RISC-V) to get industry buy-in?