[Mlir-commits] [mlir] [mlir][UB] Add `ub.unreachable` operation (PR #169872)

Jakub Kuderski llvmlistbot at llvm.org
Sun Nov 30 05:55:10 PST 2025


================
@@ -19,3 +19,18 @@ func.func @check_poison() {
 }
 
 }
+
+// -----
+
+// No successful test because the dialect conversion framework does not convert
+// unreachable blocks.
+
+module attributes {
+  spirv.target_env = #spirv.target_env<
+    #spirv.vce<v1.0, [Int8, Int16, Int64, Float16, Float64, Shader], []>, #spirv.resource_limits<>>
+} {
+func.func @check_unrechable() {
+// expected-error at +1{{cannot be used in reachable block}}
+  spirv.Unreachable
----------------
kuhar wrote:

Can you insert some control flow to make this dynamically unreachable? Right now this doesn't really test spirv conversion. @matthias-springer 

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


More information about the Mlir-commits mailing list