Reduce number of set operations.
authorChris Lattner <sabre@nondot.org>
Sun, 12 Dec 2004 22:16:13 +0000 (22:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 12 Dec 2004 22:16:13 +0000 (22:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18839 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ADCE.cpp

index 22b4c347dcb4a2dafe7699ab78d68cbd7b5dbb01..c7d349932c9e8c14d863d1ade3be66353e751917 100644 (file)
@@ -91,9 +91,8 @@ private:
   TerminatorInst *convertToUnconditionalBranch(TerminatorInst *TI);
 
   inline void markInstructionLive(Instruction *I) {
-    if (LiveSet.count(I)) return;
+    if (!LiveSet.insert(I).second) return;
     DEBUG(std::cerr << "Insn Live: " << *I);
-    LiveSet.insert(I);
     WorkList.push_back(I);
   }