[llvm-commits] [llvm] r108132 - /llvm/trunk/lib/Transforms/Utils/Local.cpp

Gabor Greif ggreif at gmail.com
Mon Jul 12 03:49:54 PDT 2010


Author: ggreif
Date: Mon Jul 12 05:49:54 2010
New Revision: 108132

URL: http://llvm.org/viewvc/llvm-project?rev=108132&view=rev
Log:
cache dereferenced iterators

Modified:
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=108132&r1=108131&r2=108132&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Mon Jul 12 05:49:54 2010
@@ -432,9 +432,11 @@
   // Use that list to make another list of common predecessors of BB and Succ
   BlockSet CommonPreds;
   for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
-        PI != PE; ++PI)
-    if (BBPreds.count(*PI))
-      CommonPreds.insert(*PI);
+       PI != PE; ++PI) {
+    BasicBlock *P = *PI;
+    if (BBPreds.count(P))
+      CommonPreds.insert(P);
+  }
 
   // Shortcut, if there are no common predecessors, merging is always safe
   if (CommonPreds.empty())





More information about the llvm-commits mailing list