[llvm] [SPIR-V] Emit UniformId decoration as OpDecorateId with a Scope id operand (PR #207958)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 08:47:09 PDT 2026


================
@@ -318,9 +318,27 @@ void buildOpSpirvDecorations(Register Reg, MachineIRBuilder &MIRBuilder,
             static_cast<uint32_t>(SPIRV::Decoration::FPFastMathMode)) {
       continue; // Ignored.
     }
-    auto MIB = MIRBuilder.buildInstr(SPIRV::OpDecorate)
-                   .addUse(Reg)
-                   .addImm(static_cast<uint32_t>(DecorationId->getZExtValue()));
+    uint32_t Dec = static_cast<uint32_t>(DecorationId->getZExtValue());
+    if (Dec == static_cast<uint32_t>(SPIRV::Decoration::UniformId)) {
+      ConstantInt *ScopeV =
+          OpMD->getNumOperands() > 1
----------------
aobolensk wrote:

Applied

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


More information about the llvm-commits mailing list