[llvm-branch-commits] [llvm][lld][RISCV] Support x3_reg_usage (PR #84598)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 8 19:12:14 PST 2024


https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/84598

This patch adds basic support for the Tag_RISCV_x3_reg_usage attribute
specified in:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#tag_riscv_x3_reg_usage-16-uleb128value
It adds support for merging the x3_reg_usage attribute in the linker,
and basic support for the attribute in attribute parser.

Enabling this feature will allow targets to avoid challenges with mixing
object files with different expectations for how x3/gp is used.

Merging x3_reg_usage tags with different values is considered an error,
with one exception. The value 0 can merge with 1 or 2 value. After the
merge, the resulting value will be the non-zero one.





More information about the llvm-branch-commits mailing list