reuse result of operator*, it is expensive to recompute
authorGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 09:50:51 +0000 (09:50 +0000)
committerGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 09:50:51 +0000 (09:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107959 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index 7b38052257aac7890dbc818d7907e5abb2aae68d..9be01dd96f85d1bc2f1182cad29a62b653abd0d3 100644 (file)
@@ -757,9 +757,11 @@ public:
     typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
     for (typename InvBlockTraits::ChildIteratorType I =
          InvBlockTraits::child_begin(BB), E = InvBlockTraits::child_end(BB);
-         I != E; ++I)
-      if (DT.dominates(BB, *I))   // If BB dominates its predecessor...
-        TodoStack.push_back(*I);
+         I != E; ++I) {
+      typename InvBlockTraits::NodeType *N = *I;
+      if (DT.dominates(BB, N))   // If BB dominates its predecessor...
+          TodoStack.push_back(N);
+    }
 
     if (TodoStack.empty()) return 0;  // No backedges to this block...