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

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 09:50:47 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

Assisted-by: Claude

---
Full diff: https://github.com/llvm/llvm-project/pull/228519.diff


1 Files Affected:

- (modified) llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp (+14-1) 


``````````diff
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: {

``````````

</details>


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


More information about the llvm-commits mailing list