[llvm] [SPIR-V] Fix OpVectorExtractDynamic operand type (PR #189635)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 04:48:51 PDT 2026
https://github.com/aobolensk created https://github.com/llvm/llvm-project/pull/189635
vID is a register class for integer vector registers only. vfID (float vector registers) should be also accepted. Aligning the definition with other instructions of this kind
related to #188703
>From 3241908077a61fd53923f7a6ebed7829fe5783ef Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
Date: Tue, 31 Mar 2026 13:43:29 +0200
Subject: [PATCH] [SPIR-V] Fix OpVectorExtractDynamic operand type
---
llvm/lib/Target/SPIRV/SPIRVInstrInfo.td | 2 +-
llvm/test/CodeGen/SPIRV/instructions/vector-shuffle.ll | 5 +----
.../test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll | 5 +----
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
index 84fbfce31cb78..d890db91ac782 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
+++ b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
@@ -450,7 +450,7 @@ def OpRoundFToTF32INTEL : UnOp<"OpRoundFToTF32INTEL", 6426>;
// 3.42.12 Composite Instructions
-def OpVectorExtractDynamic: Op<77, (outs ID:$res), (ins TYPE:$type, vID:$vec, ID:$idx),
+def OpVectorExtractDynamic: Op<77, (outs ID:$res), (ins TYPE:$type, ID:$vec, ID:$idx),
"$res = OpVectorExtractDynamic $type $vec $idx">;
def OpVectorInsertDynamic: Op<78, (outs ID:$res), (ins TYPE:$ty, ID:$vec, ID:$comp, ID:$idx),
"$res = OpVectorInsertDynamic $ty $vec $comp $idx">;
diff --git a/llvm/test/CodeGen/SPIRV/instructions/vector-shuffle.ll b/llvm/test/CodeGen/SPIRV/instructions/vector-shuffle.ll
index 9c35d4ee9b1c5..87f13290b09fa 100644
--- a/llvm/test/CodeGen/SPIRV/instructions/vector-shuffle.ll
+++ b/llvm/test/CodeGen/SPIRV/instructions/vector-shuffle.ll
@@ -1,7 +1,4 @@
-; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
-
-; TODO: This test currently fails with LLVM_ENABLE_EXPENSIVE_CHECKS enabled
-; XFAIL: expensive_checks
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
; CHECK-DAG: OpName [[SHFv4:%.+]] "shuffle_v4"
; CHECK-DAG: OpName [[INSv4:%.+]] "insert_v4"
diff --git a/llvm/test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll b/llvm/test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll
index 2b67c303b33e2..46be3059246b0 100644
--- a/llvm/test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll
+++ b/llvm/test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll
@@ -1,7 +1,4 @@
-; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
-
-; TODO: This test currently fails with LLVM_ENABLE_EXPENSIVE_CHECKS enabled
-; XFAIL: expensive_checks
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
; CHECK-SPIRV: OpName %[[#vec:]] "vec"
; CHECK-SPIRV: OpName %[[#index:]] "index"
More information about the llvm-commits
mailing list