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

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 06:53:05 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))
----------------
maarquitos14 wrote:

It's not useful because after the patch, there is no conflict anymore, but having it would have helped us caught the error much more easily. Aside from that, it's just honoring `--avoid-capabilities` flag: my command was explicitly passing `--avoid-capabilities=shader`, but it was generating `shader` anyway, which was not complying with the command line flag. With this change, we make sure the flag is acting as expected.

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


More information about the llvm-commits mailing list