[llvm] [IR] llvm.reloc.none intrinsic for no-op symbol references (PR #147427)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 21:48:34 PDT 2025
================
@@ -30439,6 +30439,38 @@ This intrinsic does nothing, but optimizers must consider it a use of its single
operand and should try to preserve the intrinsic and its position in the
function.
+.. _llvm_reloc_none:
+
+'``llvm.reloc.none``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ declare void @llvm.reloc.none(ptrty %ptr)
+
+Overview:
+"""""""""
+
+The ``llvm.reloc.none`` intrinsic emits a no-op relocation against a given
+operand symbol. This can bring the symbol
+definition into the link without emitting any code or data to the binary for
+that purpose.
----------------
arsenm wrote:
Why against a pointer type? We have the llvm.amdgcn.reloc.constant intrinsic for similar purposes but uses metadata for the string name of the symbol
https://github.com/llvm/llvm-project/pull/147427
More information about the llvm-commits
mailing list