From: Simon Pilgrim Date: Wed, 13 Jan 2021 17:14:07 +0000 (+0000) Subject: [DAG] visitVECTOR_SHUFFLE - use all_of to check for all-undef shuffle mask. NFCI. X-Git-Tag: llvmorg-13-init~1276 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=993c488ed2b347011d9d71990af38a82aaf5bdf5;p=platform%2Fupstream%2Fllvm.git [DAG] visitVECTOR_SHUFFLE - use all_of to check for all-undef shuffle mask. NFCI. --- diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5d9bb4e4..7e4ee3b 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())