summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-04-19 15:31:11 +0000
committerSanjay Patel <spatel@rotateright.com>2019-04-19 15:31:11 +0000
commite197c617a64c1deaa412f24c0e398569bec2f1c8 (patch)
tree0f77e07c6451a55a47bb99d53c1405fae6c3fbea /llvm/lib/CodeGen
parente145a540cc906c0ee0fd9e3ab2dc463a193eb91c (diff)
downloadbcm5719-llvm-e197c617a64c1deaa412f24c0e398569bec2f1c8.tar.gz
bcm5719-llvm-e197c617a64c1deaa412f24c0e398569bec2f1c8.zip
[SelectionDAG] soften splat mask assert/unreachable (PR41535)
These are general queries, so they should not die when given a degenerate input like an all undef mask. Callers should be able to deal with an op that will eventually be simplified away. llvm-svn: 358761
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
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.
OpenPOWER on IntegriCloud