From: Duncan P. N. Exon Smith Date: Fri, 25 Apr 2014 04:38:20 +0000 (+0000) Subject: blockfreq: Unwrap from Loops X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e249a45b5b72f82a6e1cdbffd71fd24790776cbd;p=oota-llvm.git blockfreq: Unwrap from Loops When unwrapping loops, just visit the loops rather than all nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207186 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BlockFrequencyInfoImpl.cpp b/lib/Analysis/BlockFrequencyInfoImpl.cpp index 6b65bf6478e..fd4e7448acb 100644 --- a/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -851,10 +851,8 @@ void BlockFrequencyInfoImplBase::unwrapLoops() { for (size_t Index = 0; Index < Working.size(); ++Index) Freqs[Index].Floating = Working[Index].Mass.toFloat(); - for (size_t Index = 0; Index < Working.size(); ++Index) { - if (Working[Index].isLoopHeader()) - unwrapLoopPackage(*this, BlockNode(Index)); - } + for (const LoopData &L : Loops) + unwrapLoopPackage(*this, L.getHeader()); } void BlockFrequencyInfoImplBase::finalizeMetrics() {