[llvm-branch-commits] [llvm] [SelectionDAG] Track demanded concat elements in noundef checks (PR #200932)

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 2 02:13:40 PDT 2026


================
@@ -5665,6 +5665,32 @@ bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op,
     }
     return true;
 
+  case ISD::CONCAT_VECTORS: {
+    if (!DemandedElts)
+      return true;
+
+    EVT VT = Op.getValueType();
+    if (!VT.isFixedLengthVector())
+      return all_of(Op->ops(), [&](SDValue V) {
+        return isGuaranteedNotToBeUndefOrPoison(V, Kind, Depth + 1);
+      });
+
+    assert(DemandedElts.getBitWidth() == VT.getVectorNumElements() &&
+           "Unexpected demanded element mask width");
+
+    EVT SubVT = Op.getOperand(0).getValueType();
+    unsigned NumSubElts = SubVT.getVectorNumElements();
+    for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i) {
----------------
RKSimon wrote:

(style)
```suggestion
    for (unsigned I = 0, E = Op.getNumOperands(); I != E; ++I) {
```

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


More information about the llvm-branch-commits mailing list