[llvm] [SPIRV] Support -fembed-bitcode=marker for non-shader modules (PR #162082)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 06:41:58 PDT 2025


================
@@ -0,0 +1,21 @@
+; RUN: llc -verify-machineinstrs -mtriple=spirv-vulkan-unknown %s -o - | FileCheck %s
----------------
jmmartinez wrote:

I think that I have now more context about all of this.

The `@llvm.embedded.module` stuff only make sense when the spirv _flavour_ is AMD's, and not for the others. In this case, the variables are in the constant addrspace(1) and are _addrspace-casted_ to the generic addrspace(4) when added to `llvm.compiler.used`.

This is allowed only in amd's flavour but is outside of spirv standard.

I think I'm going to change my strategy:
* I'll add an AMD specific pass that is only added to the pipeline if the vendor is AMD to put this kind of stuff over there.
* Maybe put this kind of test not in `test/CodeGen/SPIRV` but in a subfolder `test/CodeGen/SPIRV/amd` or something like that.

What do you think ?

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


More information about the llvm-commits mailing list