[llvm] [RISCV][docs] GP Relaxation and Small Data Limit (PR #108592)
Sam Elliott via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 16 10:46:52 PDT 2024
================
@@ -431,3 +431,29 @@ line. This currently applies to the following extensions:
* ``Zvksg``
* ``Zvksh``
* ``Zvkt``
+
+Global Pointer (GP) Relaxation and the Small Data Limit
+=======================================================
+
+Some of the RISC-V psABI variants reserve ``gp`` (``x3``) for use as a "Global Pointer", to make generating data addresses more efficient.
+
+To use this functionality, you need to be doing all of the following:
+* Use the ``medlow`` (aka ``small``) code model;
+* Not use the ``gp`` register for any other uses (some platforms use it for the shadow stack and others as a temporary -- as denoted by the ``Tag_RISCV_x3_reg_usage`` build attribute);
+* Compile your objects with Clang's ``-mrelax`` option, to enable relaxation annotations on relocatable objects;
----------------
lenary wrote:
Yes, it is worth mentioning. I'll directly commit this addition.
https://github.com/llvm/llvm-project/pull/108592
More information about the llvm-commits
mailing list