[llvm] 5bb00cd - [llvm] Use llvm::is_contained (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 22 08:57:43 PDT 2022


Author: Kazu Hirata
Date: 2022-10-22T08:57:37-07:00
New Revision: 5bb00cd309b9509b86715822ba88c5fe214a2796

URL: https://github.com/llvm/llvm-project/commit/5bb00cd309b9509b86715822ba88c5fe214a2796
DIFF: https://github.com/llvm/llvm-project/commit/5bb00cd309b9509b86715822ba88c5fe214a2796.diff

LOG: [llvm] Use llvm::is_contained (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
index 8c495c8bc820f..e154243f44708 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
@@ -598,8 +598,7 @@ class LVPatterns final {
     return matchPattern(Input, GenericMatchInfo);
   }
   bool matchOffsetPattern(LVOffset Offset) {
-    return std::find(OffsetMatchInfo.begin(), OffsetMatchInfo.end(), Offset) !=
-           OffsetMatchInfo.end();
+    return llvm::is_contained(OffsetMatchInfo, Offset);
   }
 
   void resolvePatternMatch(LVLine *Line) {

diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 769f85bda494b..aea2173062db2 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -39617,7 +39617,7 @@ static SDValue combineX86ShufflesRecursively(
   if (all_of(Mask, [](int Idx) { return Idx < 0; }))
     return getZeroVector(RootVT, Subtarget, DAG, SDLoc(Root));
   if (Ops.size() == 1 && ISD::isBuildVectorAllOnes(Ops[0].getNode()) &&
-      none_of(Mask, [](int M) { return M == SM_SentinelZero; }))
+      !llvm::is_contained(Mask, SM_SentinelZero))
     return getOnesVector(RootVT, DAG, SDLoc(Root));
 
   assert(!Ops.empty() && "Shuffle with no inputs detected");


        


More information about the llvm-commits mailing list