[llvm] [NFC][SPIR-V] Add spirv-val RUN lines where missing (PR #227245)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 02:54:23 PDT 2026


https://github.com/aobolensk updated https://github.com/llvm/llvm-project/pull/227245

>From 9443624f368b370f60f286133feccff6fd92eec4 Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
Date: Tue, 29 Sep 2026 11:46:45 +0200
Subject: [PATCH 1/2] [NFC][SPIR-V] Add spirv-val RUN lines where missing

---
 .../CodeGen/SPIRV/extensions/SPV_KHR_abort/trap-ext-disabled.ll | 1 +
 .../SPIRV/extensions/SPV_KHR_bit_instructions_remove_cap_if.ll  | 1 +
 llvm/test/CodeGen/SPIRV/get-global-id-non-integer-dim.ll        | 2 ++
 llvm/test/CodeGen/SPIRV/linkage/available-externally-global.ll  | 2 ++
 llvm/test/CodeGen/SPIRV/malformed-mangled-builtin-name.ll       | 1 +
 5 files changed, 7 insertions(+)

diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/trap-ext-disabled.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/trap-ext-disabled.ll
index 7cf78e8553303..a1d0bb90e25d3 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/trap-ext-disabled.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/trap-ext-disabled.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
 
 ;; When SPV_KHR_abort is not enabled, llvm.trap is dropped (existing behavior),
 ;; and no AbortKHR capability/extension/instruction is emitted.
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_bit_instructions_remove_cap_if.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_bit_instructions_remove_cap_if.ll
index cec59cd4fd21c..04c3e61e7352b 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_bit_instructions_remove_cap_if.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_bit_instructions_remove_cap_if.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s --spirv-ext=+SPV_KHR_bit_instructions -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown --spirv-ext=+SPV_KHR_bit_instructions %s -o - -filetype=obj | spirv-val %}
 
 ; CHECK: OpCapability Shader
 ; CHECK-NOT: OpCapability BitInstructions
diff --git a/llvm/test/CodeGen/SPIRV/get-global-id-non-integer-dim.ll b/llvm/test/CodeGen/SPIRV/get-global-id-non-integer-dim.ll
index a9c19df446eaa..39bb4ab5659a0 100644
--- a/llvm/test/CodeGen/SPIRV/get-global-id-non-integer-dim.ll
+++ b/llvm/test/CodeGen/SPIRV/get-global-id-non-integer-dim.ll
@@ -1,5 +1,7 @@
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown -spirv-ext=+SPV_KHR_bfloat16 %s -o - | FileCheck %s
 ; RUN: llc -O2 -mtriple=spirv64-unknown-unknown -spirv-ext=+SPV_KHR_bfloat16 %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown -spirv-ext=+SPV_KHR_bfloat16 %s -o - -filetype=obj | spirv-val %}
+; RUN: %if spirv-tools %{ llc -O2 -mtriple=spirv64-unknown-unknown -spirv-ext=+SPV_KHR_bfloat16 %s -o - -filetype=obj | spirv-val %}
 
 ; get_global_id and its sibling workgroup-query builtins take an integer
 ; dimension index.
diff --git a/llvm/test/CodeGen/SPIRV/linkage/available-externally-global.ll b/llvm/test/CodeGen/SPIRV/linkage/available-externally-global.ll
index 93672265cbdd2..9996367785d87 100644
--- a/llvm/test/CodeGen/SPIRV/linkage/available-externally-global.ll
+++ b/llvm/test/CodeGen/SPIRV/linkage/available-externally-global.ll
@@ -3,6 +3,7 @@
 ; when -spirv-preserve-auxdata is passed.
 
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=NOAUX
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
 
 ; NOAUX-NOT: NonSemantic.AuxData
 ; NOAUX-DAG: OpName %[[#ae_gv:]] "ae_gv"
@@ -13,6 +14,7 @@
 ; Linkage annotation recording the original available_externally linkage.
 
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info --spirv-preserve-auxdata %s -o - | FileCheck %s --check-prefix=AUX
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info --spirv-preserve-auxdata %s -o - -filetype=obj | spirv-val %}
 
 ; AUX-DAG: %[[#auxset:]] = OpExtInstImport "NonSemantic.AuxData"
 ; AUX-DAG: OpName %[[#ae_gv:]] "ae_gv"
diff --git a/llvm/test/CodeGen/SPIRV/malformed-mangled-builtin-name.ll b/llvm/test/CodeGen/SPIRV/malformed-mangled-builtin-name.ll
index e260e7333d332..c5e60b69c8060 100644
--- a/llvm/test/CodeGen/SPIRV/malformed-mangled-builtin-name.ll
+++ b/llvm/test/CodeGen/SPIRV/malformed-mangled-builtin-name.ll
@@ -1,6 +1,7 @@
 ; A call target with a malformed mangled name must not crash the demangler.
 
 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o /dev/null
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
 
 declare spir_func i64 @"_Z&3gmt_global_idj"(i32)
 

>From 27476cbcdaba102f3084b49e308c568b23f9f3c2 Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
Date: Tue, 29 Sep 2026 11:54:10 +0200
Subject: [PATCH 2/2] more

---
 llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll                  | 2 ++
 llvm/test/CodeGen/SPIRV/debug-info/debug-value-typedef-cycle.ll | 1 +
 .../SPIRV/extensions/SPV_KHR_abort/debugtrap-not-translated.ll  | 2 ++
 .../SPV_KHR_non_semantic_info/preserve-gv-attributes.ll         | 1 +
 .../SPV_KHR_non_semantic_info/preserve-gv-metadata.ll           | 1 +
 llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll           | 1 +
 llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll               | 1 +
 7 files changed, 9 insertions(+)

diff --git a/llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll b/llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll
index faac15fa24bf9..a823f8e9ea236 100644
--- a/llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll
+++ b/llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll
@@ -1,6 +1,8 @@
 ; RUN: opt -S -passes='spirv-cbuffer-access' %s -o - | FileCheck %s
 ; RUN: llc %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc  %s -o - -filetype=obj | spirv-val %}
 ; RUN: llc %s -O3 -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O3 %s -o - -filetype=obj | spirv-val %}
 
 target triple = "spirv-unknown-vulkan1.3-compute"
 
diff --git a/llvm/test/CodeGen/SPIRV/debug-info/debug-value-typedef-cycle.ll b/llvm/test/CodeGen/SPIRV/debug-info/debug-value-typedef-cycle.ll
index ae53ce6fd73ab..3567646df512f 100644
--- a/llvm/test/CodeGen/SPIRV/debug-info/debug-value-typedef-cycle.ll
+++ b/llvm/test/CodeGen/SPIRV/debug-info/debug-value-typedef-cycle.ll
@@ -1,4 +1,5 @@
 ; RUN: llc --verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc --verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info %s -o - -filetype=obj | spirv-val %}
 
 ; A typedef chain that closes on itself. Verifier::visitDIDerivedType checks
 ; only that a base type is a type, so this passes the IR verifier, and
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/debugtrap-not-translated.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/debugtrap-not-translated.ll
index 8ac35926e09b1..07d3242a1286c 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/debugtrap-not-translated.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_abort/debugtrap-not-translated.ll
@@ -1,5 +1,7 @@
 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_KHR_abort %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_KHR_abort %s -o - -filetype=obj | spirv-val %}
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_abort %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_abort %s -o - -filetype=obj | spirv-val %}
 
 ;; Negative test: llvm.debugtrap must NOT lower to OpAbortKHR. Only llvm.trap
 ;; and llvm.ubsantrap are translated to OpAbortKHR; debugtrap is dropped (no
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-attributes.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-attributes.ll
index ab7e6f7eaa0e8..e782bedc96416 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-attributes.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-attributes.ll
@@ -4,6 +4,7 @@
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown \
 ; RUN:   --spirv-ext=+SPV_KHR_non_semantic_info -spirv-preserve-auxdata \
 ; RUN:   %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info -spirv-preserve-auxdata %s -o - -filetype=obj | spirv-val %}
 
 ; CHECK: %[[#Import:]] = OpExtInstImport "NonSemantic.AuxData"
 
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-metadata.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-metadata.ll
index 3759ca362af67..32d936b591768 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-metadata.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_non_semantic_info/preserve-gv-metadata.ll
@@ -5,6 +5,7 @@
 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown \
 ; RUN:   --spirv-ext=+SPV_KHR_non_semantic_info -spirv-preserve-auxdata \
 ; RUN:   %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info -spirv-preserve-auxdata %s -o - -filetype=obj | spirv-val %}
 
 ; CHECK: %[[#Import:]] = OpExtInstImport "NonSemantic.AuxData"
 
diff --git a/llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll b/llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
index 1401ba7f8513e..95a3777f2bb15 100644
--- a/llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
+++ b/llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s --check-prefix=CHECK
+; RUN: %if spirv-tools %{ llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
 
 ; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
 ; CHECK-ERROR: Function used as a data pointer requires SPV_INTEL_function_pointers extension
diff --git a/llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll b/llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll
index 3ec797aa8d2d8..9ff5bc296a071 100644
--- a/llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll
+++ b/llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll
@@ -1,4 +1,5 @@
 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-vulkan-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -verify-machineinstrs -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val --target-env vulkan1.3 %}
 
 %struct.T = type { [3 x <2 x float>] }
 %struct.S = type { float, <3 x float>, %struct.T }



More information about the llvm-commits mailing list