[llvm-branch-commits] [llvm] 215c1b1 - [Transforms] Use is_contained (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Dec 12 09:42:03 PST 2020


Author: Kazu Hirata
Date: 2020-12-12T09:37:49-08:00
New Revision: 215c1b19359e2fcc7f01e97b742cbb26aeb678a0

URL: https://github.com/llvm/llvm-project/commit/215c1b19359e2fcc7f01e97b742cbb26aeb678a0
DIFF: https://github.com/llvm/llvm-project/commit/215c1b19359e2fcc7f01e97b742cbb26aeb678a0.diff

LOG: [Transforms] Use is_contained (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/HotColdSplitting.cpp
    llvm/lib/Transforms/IPO/Inliner.cpp
    llvm/lib/Transforms/Vectorize/VPlanValue.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index 042a8dbad6bd..49078b9baead 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -283,7 +283,7 @@ static int getOutliningPenalty(ArrayRef<BasicBlock *> Region,
     }
 
     for (BasicBlock *SuccBB : successors(BB)) {
-      if (find(Region, SuccBB) == Region.end()) {
+      if (!is_contained(Region, SuccBB)) {
         NoBlocksReturn = false;
         SuccsOutsideRegion.insert(SuccBB);
       }

diff  --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index ae4441b07c4c..b0ac3d31f468 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -906,7 +906,7 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
           // Note that after this point, it is an error to do anything other
           // than use the callee's address or delete it.
           Callee.dropAllReferences();
-          assert(find(DeadFunctions, &Callee) == DeadFunctions.end() &&
+          assert(!is_contained(DeadFunctions, &Callee) &&
                  "Cannot put cause a function to become dead twice!");
           DeadFunctions.push_back(&Callee);
           CalleeWasDeleted = true;

diff  --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h
index a7e874009dc4..b1f2439882f7 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -260,7 +260,7 @@ class VPDef {
   void removeDefinedValue(VPValue *V) {
     assert(V->getDef() == this &&
            "can only remove VPValue linked with this VPDef");
-    assert(find(DefinedValues, V) != DefinedValues.end() &&
+    assert(is_contained(DefinedValues, V) &&
            "VPValue to remove must be in DefinedValues");
     erase_value(DefinedValues, V);
     V->Def = nullptr;


        


More information about the llvm-branch-commits mailing list