Do one lookup instead of two.
authorDan Gohman <gohman@apple.com>
Sun, 29 Aug 2010 15:18:49 +0000 (15:18 +0000)
committerDan Gohman <gohman@apple.com>
Sun, 29 Aug 2010 15:18:49 +0000 (15:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 64d493c514de86c4fe0661691fa2001a9ea83489..8370c08d2e1458ab8033b849703d0205743691b6 100644 (file)
@@ -161,9 +161,10 @@ RegUseTracker::DropUse(size_t LUIdx) {
 
 bool
 RegUseTracker::isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const {
-  if (!RegUsesMap.count(Reg)) return false;
-  const SmallBitVector &UsedByIndices =
-    RegUsesMap.find(Reg)->second.UsedByIndices;
+  RegUsesTy::const_iterator I = RegUsesMap.find(Reg);
+  if (I == RegUsesMap.end())
+    return false;
+  const SmallBitVector &UsedByIndices = I->second.UsedByIndices;
   int i = UsedByIndices.find_first();
   if (i == -1) return false;
   if ((size_t)i != LUIdx) return true;