From d266b0fcd8325f2036b3769a283fe2702f7dd427 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Fri, 9 Jul 2010 09:50:51 +0000 Subject: [PATCH] reuse result of operator*, it is expensive to recompute llvm-svn: 107959 --- include/llvm/Analysis/LoopInfo.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 7b38052257a..9be01dd96f8 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -757,9 +757,11 @@ public: typedef GraphTraits > 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...