Relax the constraint more in MemoryDependencyAnalysis.cpp
[oota-llvm.git] / lib / Analysis / BasicAliasAnalysis.cpp
index d7f4ebe3b9b1e9352c0efe018d6331c8b35bf850..bcb005ca6893516b8da13df0481d89eb1ece0817 100644 (file)
@@ -1362,10 +1362,8 @@ bool BasicAliasAnalysis::isValueEqualInPotentialCycles(const Value *V,
   // Make sure that the visited phis cannot reach the Value. This ensures that
   // the Values cannot come from different iterations of a potential cycle the
   // phi nodes could be involved in.
-  for (SmallPtrSet<const BasicBlock *, 8>::iterator PI = VisitedPhiBBs.begin(),
-                                                    PE = VisitedPhiBBs.end();
-       PI != PE; ++PI)
-    if (isPotentiallyReachable((*PI)->begin(), Inst, DT, LI))
+  for (auto *P : VisitedPhiBBs)
+    if (isPotentiallyReachable(P->begin(), Inst, DT, LI))
       return false;
 
   return true;