summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-01-13 17:14:07 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-01-13 17:19:41 +0000
commit993c488ed2b347011d9d71990af38a82aaf5bdf5 (patch)
treee43988cfe9cffaaad061052822494406c1fb3375
parentefb6e45d2be8e3e0843bdc4c2766e6910083c08e (diff)
downloadllvm-993c488ed2b347011d9d71990af38a82aaf5bdf5.tar.gz
[DAG] visitVECTOR_SHUFFLE - use all_of to check for all-undef shuffle mask. NFCI.
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5d9bb4e4a98b..7e4ee3beeeed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -20901,11 +20901,7 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
}
// Check if all indices in Mask are Undef. In case, propagate Undef.
- bool isUndefMask = true;
- for (unsigned i = 0; i != NumElts && isUndefMask; ++i)
- isUndefMask &= Mask[i] < 0;
-
- if (isUndefMask)
+ if (llvm::all_of(Mask, [](int M) { return M < 0; }))
return DAG.getUNDEF(VT);
if (!SV0.getNode())