[llvm-branch-commits] [llvm] 56edfca - [Target, Transforms] Use contains (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Dec 19 10:48:22 PST 2020


Author: Kazu Hirata
Date: 2020-12-19T10:43:19-08:00
New Revision: 56edfcada900561e06992b644e55785573af5114

URL: https://github.com/llvm/llvm-project/commit/56edfcada900561e06992b644e55785573af5114
DIFF: https://github.com/llvm/llvm-project/commit/56edfcada900561e06992b644e55785573af5114.diff

LOG: [Target, Transforms] Use contains (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
    llvm/lib/Transforms/IPO/IROutliner.cpp
    llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp b/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
index 04749cdd61c4..1ae73bc8de43 100644
--- a/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
+++ b/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
@@ -121,7 +121,7 @@ static bool hasPCRelativeForm(MachineInstr &Use) {
       for (auto BBI = MBB.instr_begin(); BBI != MBB.instr_end(); ++BBI) {
         // Skip load immediate that is marked to be erased later because it
         // cannot be used to replace any other instructions.
-        if (InstrsToErase.find(&*BBI) != InstrsToErase.end())
+        if (InstrsToErase.contains(&*BBI))
           continue;
         // Skip non-load immediate.
         unsigned Opc = BBI->getOpcode();

diff  --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp
index 7d39b84b3ca9..9985d9a09d64 100644
--- a/llvm/lib/Transforms/IPO/IROutliner.cpp
+++ b/llvm/lib/Transforms/IPO/IROutliner.cpp
@@ -162,7 +162,7 @@ void IROutliner::pruneIncompatibleRegions(
     unsigned EndIdx = IRSC.getEndIdx();
 
     for (unsigned Idx = StartIdx; Idx <= EndIdx; Idx++)
-      if (Outlined.find(Idx) != Outlined.end()) {
+      if (Outlined.contains(Idx)) {
         PreviouslyOutlined = true;
         break;
       }

diff  --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 1a1d0c01f77e..2979225c6016 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -2370,8 +2370,7 @@ struct DSEState {
         << "Trying to eliminate MemoryDefs at the end of the function\n");
     for (int I = MemDefs.size() - 1; I >= 0; I--) {
       MemoryDef *Def = MemDefs[I];
-      if (SkipStores.find(Def) != SkipStores.end() ||
-          !isRemovable(Def->getMemoryInst()))
+      if (SkipStores.contains(Def) || !isRemovable(Def->getMemoryInst()))
         continue;
 
       Instruction *DefI = Def->getMemoryInst();


        


More information about the llvm-branch-commits mailing list