[llvm] [SelectionDAG] Implement SDTCisEltOfVec in verifyNode. (PR #228519)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 09:49:49 PDT 2026


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/228519

Assisted-by: Claude

>From 35cb5ec50937ecb7bebe114fdfb301d9549da0e3 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 2 Oct 2026 09:48:47 -0700
Subject: [PATCH] [SelectionDAG] Implement SDTCisEltOfVec in verifyNode.

Assisted-by: Claude
---
 llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
index ddb73ae0f03f9..e84305b8e134a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
@@ -221,8 +221,21 @@ void SDNodeInfo::verifyNode(const SelectionDAG &DAG, const SDNode *N) const {
       break;
     case SDTCisOpSmallerThanOp:
       break;
-    case SDTCisEltOfVec:
+    case SDTCisEltOfVec: {
+      SDNodeValue VecVal = GetConstraintValue(C.ConstrainingValIdx);
+      EVT VecVT = VecVal.getValueType();
+
+      if (!VecVT.isVector()) {
+        SS << VecVal << " must have vector type, but has type " << VecVT;
+        reportNodeError(DAG, N, SS.str());
+      }
+      if (VT != VecVT.getVectorElementType()) {
+        SS << Val << " must have " << VecVT.getVectorElementType()
+           << " type (element type of " << VecVal << "), but has type " << VT;
+        reportNodeError(DAG, N, SS.str());
+      }
       break;
+    }
     case SDTCisSubVecOfVec:
       break;
     case SDTCVecEltisVT: {



More information about the llvm-commits mailing list