diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-28 16:39:36 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-28 16:39:36 +0000 |
commit | 520b6e3fa5c9c01ed66e70c925e78d518504a983 (patch) | |
tree | 59f17a87120b4c6fafc06e5555f6cf18ad726258 /lib/CodeGen | |
parent | e4fae84b0b13bd5d66cf619fd2108dbb6064395d (diff) | |
download | external_llvm-520b6e3fa5c9c01ed66e70c925e78d518504a983.zip external_llvm-520b6e3fa5c9c01ed66e70c925e78d518504a983.tar.gz external_llvm-520b6e3fa5c9c01ed66e70c925e78d518504a983.tar.bz2 |
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index cebd614..a36dca6 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -1878,9 +1878,8 @@ SDValue DAGTypeLegalizer::WidenVecRes_BUILD_VECTOR(SDNode *N) { unsigned WidenNumElts = WidenVT.getVectorNumElements(); SmallVector<SDValue, 16> NewOps(N->op_begin(), N->op_end()); - NewOps.reserve(WidenNumElts); - for (unsigned i = NumElts; i < WidenNumElts; ++i) - NewOps.push_back(DAG.getUNDEF(EltVT)); + assert(WidenNumElts >= NumElts && "Shrinking vector instead of widening!"); + NewOps.append(WidenNumElts - NumElts, DAG.getUNDEF(EltVT)); return DAG.getNode(ISD::BUILD_VECTOR, dl, WidenVT, &NewOps[0], NewOps.size()); } |