1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

cache another dereferenced iterator

llvm-svn: 108421
This commit is contained in:
Gabor Greif 2010-07-15 10:19:23 +00:00
parent 285c87d8b3
commit 0b8d6a43c0

View File

@ -71,22 +71,24 @@ ProfileInfoT<Function,BasicBlock>::getExecutionCount(const BasicBlock *BB) {
// Are there zero predecessors of this block? // Are there zero predecessors of this block?
if (PI == PE) { if (PI == PE) {
Edge e = getEdge(0,BB); Edge e = getEdge(0, BB);
Count = getEdgeWeight(e); Count = getEdgeWeight(e);
} else { } else {
// Otherwise, if there are predecessors, the execution count of this block is // Otherwise, if there are predecessors, the execution count of this block is
// the sum of the edge frequencies from the incoming edges. // the sum of the edge frequencies from the incoming edges.
std::set<const BasicBlock*> ProcessedPreds; std::set<const BasicBlock*> ProcessedPreds;
Count = 0; Count = 0;
for (; PI != PE; ++PI) for (; PI != PE; ++PI) {
if (ProcessedPreds.insert(*PI).second) { const BasicBlock *P = *PI;
double w = getEdgeWeight(getEdge(*PI, BB)); if (ProcessedPreds.insert(P).second) {
double w = getEdgeWeight(getEdge(P, BB));
if (w == MissingValue) { if (w == MissingValue) {
Count = MissingValue; Count = MissingValue;
break; break;
} }
Count += w; Count += w;
} }
}
} }
// If the predecessors did not suffice to get block weight, try successors. // If the predecessors did not suffice to get block weight, try successors.