[Mlir-commits] [mlir] [mlir][spirv] Support SPIR-V 1.6 in deserializer (PR #151958)

Igor Wodiany llvmlistbot at llvm.org
Mon Aug 4 06:05:18 PDT 2025


https://github.com/IgWod-IMG created https://github.com/llvm/llvm-project/pull/151958

After skimming through the changes in the spec, there does not seem to be anything that will cause issues. A new roundtrip test has been added and validate with `spirv-val` just in case.

>From 47cf1e3084904c70de852bb0db48af8189b131af Mon Sep 17 00:00:00 2001
From: Igor Wodiany <igor.wodiany at imgtec.com>
Date: Mon, 4 Aug 2025 12:46:02 +0000
Subject: [PATCH] [mlir][spirv] Support SPIR-V 1.6 in deserializer

After skimming through the changes in spec, there does not seem
to be anything that will cause issues. A new roundtrip test has
been added and validate with `spirv-val` just in case.
---
 mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp | 1 +
 mlir/test/Target/SPIRV/module.mlir                     | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
index 88931b53a6889..33cac1663deb1 100644
--- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
+++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
@@ -138,6 +138,7 @@ LogicalResult spirv::Deserializer::processHeader() {
       MIN_VERSION_CASE(3);
       MIN_VERSION_CASE(4);
       MIN_VERSION_CASE(5);
+      MIN_VERSION_CASE(6);
 #undef MIN_VERSION_CASE
     default:
       return emitError(unknownLoc, "unsupported SPIR-V minor version: ")
diff --git a/mlir/test/Target/SPIRV/module.mlir b/mlir/test/Target/SPIRV/module.mlir
index 165412485a088..dcdcab8097e41 100644
--- a/mlir/test/Target/SPIRV/module.mlir
+++ b/mlir/test/Target/SPIRV/module.mlir
@@ -20,6 +20,12 @@ spirv.module Logical GLSL450 requires #spirv.vce<v1.5, [Shader], []> {
 
 // -----
 
+// CHECK: v1.6
+spirv.module Logical GLSL450 requires #spirv.vce<v1.6, [Shader, Linkage], []> {
+}
+
+// -----
+
 // CHECK: [Shader, Float16]
 spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader, Float16], []> {
 }



More information about the Mlir-commits mailing list