[Mlir-commits] [mlir] Reland "[mlir][spirv] Fix UpdateVCEPass to deduce the correct set of capabilities" (PR #151502)

Jakub Kuderski llvmlistbot at llvm.org
Thu Jul 31 05:35:45 PDT 2025


================
@@ -95,6 +95,14 @@ static LogicalResult checkAndUpdateCapabilityRequirements(
   return success();
 }
 
+static void addAllImpliedCapabilities(SetVector<spirv::Capability> &caps) {
+  for (unsigned i = 0; i < caps.size(); ++i) {
+    spirv::Capability cap = caps[i];
+    ArrayRef<spirv::Capability> impliedCaps = getDirectImpliedCapabilities(cap);
+    caps.insert_range(impliedCaps);
+  }
----------------
kuhar wrote:

Can we collect all the new caps in a new set vector and update `caps` at the very end after the loop? I don't like this implementation because it's not immediately obvious if insertions change the iteration order in a way that would make use inadvertently skip some values.

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


More information about the Mlir-commits mailing list