From bc19e50865d65b20239c9131d98c27126111e9d4 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 16 Apr 2025 00:16:03 -0700 Subject: [PATCH] [CodeGen] Construct SmallVector with ArrayRef (NFC) Note that we can drop the call to reserve because the constructor that takes ArrayRef calls append, which in turn calls reserve. --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d72be359867ca..8322d243b5bc3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -24741,10 +24741,8 @@ static SDValue combineConcatVectorOfShuffleAndItsOperands( // We are going to pad the shuffle operands, so any indice, that was picking // from the second operand, must be adjusted. - SmallVector AdjustedMask; - AdjustedMask.reserve(SVN->getMask().size()); + SmallVector AdjustedMask(SVN->getMask()); assert(SVN->getOperand(1).isUndef() && "Expected unary shuffle!"); - append_range(AdjustedMask, SVN->getMask()); // Identity masks for the operands of the (padded) shuffle. SmallVector IdentityMask(2 * OpVT.getVectorNumElements());