[llvm] [IR] llvm.reloc.none intrinsic for no-op symbol references (PR #147427)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 14:55:04 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.
----------------
mysterymath wrote:

The reason being... I had no idea you could do that! This is essentially my first time monkeying in the IR; I've been a backend/linker jocky for the most part. But thanks, that does seem a lot semantically simpler. I'll make the change throughout the PR chain and report back here.

https://github.com/llvm/llvm-project/pull/147427


More information about the llvm-commits mailing list