[Target, Transforms] Use contains (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 19 Dec 2020 18:43:18 +0000 (10:43 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 19 Dec 2020 18:43:19 +0000 (10:43 -0800)
llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
llvm/lib/Transforms/IPO/IROutliner.cpp
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

index 04749cd..1ae73bc 100644 (file)
@@ -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();
index 7d39b84..9985d9a 100644 (file)
@@ -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;
       }
index 1a1d0c0..2979225 100644 (file)
@@ -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();