[Mlir-commits] [mlir] [mlir][SPIR-V] Guard update-vce pass against ops exceeding target max version (PR #212939)

Arseniy Obolenskiy llvmlistbot at llvm.org
Tue Aug 4 21:02:40 PDT 2026


================
@@ -42,6 +42,25 @@ spirv.module Logical GLSL450 attributes {
   }
 }
 
+// -----
+
+// Test rejecting an op whose max version is below what the target
+// environment allows.
+// spirv.AtomicCompareExchangeWeak is only available up to v1.3.
+
+spirv.module Logical GLSL450 attributes {
+  spirv.target_env = #spirv.target_env<
+    #spirv.vce<v1.6, [Kernel], []>, #spirv.resource_limits<>>
+} {
+  spirv.func @atomic_compare_exchange_weak(%ptr : !spirv.ptr<i32, Workgroup>, %value : i32, %comparator : i32) -> i32 "None" {
+    // expected-error @+1 {{'spirv.AtomicCompareExchangeWeak' requires max version v1.3 but target environment allows up to v1.6}}
----------------
aobolensk wrote:

Adjusted the wording, but all similar diagnostics like that have `v` prefix, because `stringifyVersion()` function used for that adds this prefix


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


More information about the Mlir-commits mailing list