[llvm] [LLVM] Maintain element type of @llvm.compiler.used/@llvm.used if it already exists (PR #162660)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 01:11:06 PDT 2025


jmmartinez wrote:

> > At the moment, the address space for the pointer stored in the llvm.compiler.used/llvm.used is not well defined:
> 
> It should be defined to 0

In that case, should the LLVM-IR verifier (or at least the linter) reject bitcode where these variables have the wrong type?

I still have to check what breaks exactly when clang emits an `addrspace(0) ptr` in `llvm.used/llvm.compiler.used`. AFAIK it is the case for SPIRV, which should be solved by https://github.com/llvm/llvm-project/pull/162678 .

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


More information about the llvm-commits mailing list