[llvm-branch-commits] [llvm] DAG: Preserve poison in more concat_vectors folds (PR #206948)

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 1 04:48:01 PDT 2026


================
@@ -7024,7 +7024,9 @@ static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
   SmallVector<SDValue, 16> Elts;
   for (SDValue Op : Ops) {
     EVT OpVT = Op.getValueType();
-    if (Op.isUndef())
+    if (Op.getOpcode() == ISD::POISON)
+      Elts.append(OpVT.getVectorNumElements(), DAG.getPOISON(SVT));
+    else if (Op.getOpcode() == ISD::UNDEF)
       Elts.append(OpVT.getVectorNumElements(), DAG.getUNDEF(SVT));
----------------
RKSimon wrote:

Create a helper if you think we're going to need more of this pattern?

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


More information about the llvm-branch-commits mailing list