[llvm] [SPIRV] Do not use OpTypeRuntimeArray in Kernel env. (PR #149522)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 04:54:31 PDT 2025


================
@@ -744,8 +744,14 @@ void SPIRV::RequirementHandler::checkSatisfiable(
     IsSatisfiable = false;
   }
 
+  AvoidCapabilitiesSet AvoidCaps;
+  if (!ST.isShader())
+    AvoidCaps.S.insert(SPIRV::Capability::Shader);
+  else
+    AvoidCaps.S.insert(SPIRV::Capability::Kernel);
+
   for (auto Cap : MinimalCaps) {
-    if (AvailableCaps.contains(Cap))
+    if (AvailableCaps.contains(Cap) && !AvoidCaps.S.contains(Cap))
----------------
Keenuts wrote:

This doesn't seem useful. I recompiled your patch with only the `OpRuntimeArray` change the the capability is not emitted.
(Since OpTypeRuntimeArray is not added, the capability is not required).

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


More information about the llvm-commits mailing list