mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 04:09:45 +00:00
Simplify std::all_of/any_of predicates by using llvm::all_of/any_of. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
213d3d3c81
commit
586141811f
@ -4987,8 +4987,7 @@ static bool getTargetShuffleMask(SDNode *N, MVT VT, bool AllowSentinelZero,
|
||||
|
||||
// Check if we're getting a shuffle mask with zero'd elements.
|
||||
if (!AllowSentinelZero)
|
||||
if (std::any_of(Mask.begin(), Mask.end(),
|
||||
[](int M){ return M == SM_SentinelZero; }))
|
||||
if (llvm::any_of(Mask, [](int M) { return M == SM_SentinelZero; }))
|
||||
return false;
|
||||
|
||||
// If we have a fake unary shuffle, the shuffle mask is spread across two
|
||||
@ -9748,7 +9747,7 @@ static SDValue lowerV8I16VectorShuffle(SDValue Op, SDValue V1, SDValue V2,
|
||||
Subtarget, DAG);
|
||||
}
|
||||
|
||||
assert(std::any_of(Mask.begin(), Mask.end(), isV1) &&
|
||||
assert(llvm::any_of(Mask, isV1) &&
|
||||
"All single-input shuffles should be canonicalized to be V1-input "
|
||||
"shuffles.");
|
||||
|
||||
@ -10149,7 +10148,7 @@ static SDValue lowerV16I8VectorShuffle(SDValue Op, SDValue V1, SDValue V2,
|
||||
// Use a mask to drop the high bytes.
|
||||
VLoHalf = DAG.getBitcast(MVT::v8i16, V);
|
||||
VLoHalf = DAG.getNode(ISD::AND, DL, MVT::v8i16, VLoHalf,
|
||||
DAG.getConstant(0x00FF, DL, MVT::v8i16));
|
||||
DAG.getConstant(0x00FF, DL, MVT::v8i16));
|
||||
|
||||
// This will be a single vector shuffle instead of a blend so nuke VHiHalf.
|
||||
VHiHalf = DAG.getUNDEF(MVT::v8i16);
|
||||
@ -24494,12 +24493,11 @@ static bool combineX86ShufflesRecursively(SDValue Op, SDValue Root,
|
||||
}
|
||||
|
||||
// Handle the all undef/zero cases early.
|
||||
if (std::all_of(Mask.begin(), Mask.end(),
|
||||
[](int Idx) { return Idx == SM_SentinelUndef; })) {
|
||||
if (llvm::all_of(Mask, [](int Idx) { return Idx == SM_SentinelUndef; })) {
|
||||
DCI.CombineTo(Root.getNode(), DAG.getUNDEF(Root.getValueType()));
|
||||
return true;
|
||||
}
|
||||
if (std::all_of(Mask.begin(), Mask.end(), [](int Idx) { return Idx < 0; })) {
|
||||
if (llvm::all_of(Mask, [](int Idx) { return Idx < 0; })) {
|
||||
// TODO - should we handle the mixed zero/undef case as well? Just returning
|
||||
// a zero mask will lose information on undef elements possibly reducing
|
||||
// future combine possibilities.
|
||||
|
Loading…
Reference in New Issue
Block a user