diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5689a152ca5..b2de2a4f343 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -9350,7 +9350,10 @@ bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) {    for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i)      /* search */; -  assert(i != e && "VECTOR_SHUFFLE node with all undef indices!"); +  // If all elements are undefined, this shuffle can be considered a splat +  // (although it should eventually get simplified away completely). +  if (i == e) +    return true;    // Make sure all remaining elements are either undef or the same as the first    // non-undef value. | 

