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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 01:17:47 PDT 2025


Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162660 at github.com>


arsenm wrote:

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

Yes. verifier failure.

> 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 #162678 .

SPIR-V probably shouldn't just drop these on the floor. It probably will need special case code to stripPointerCasts and re-package the references into whatever SPIRV type it prefers 

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


More information about the llvm-commits mailing list