Fix floating-point divide by zero, in a case where the value was not going to be used anyway.

llvm-svn: 162518
This commit is contained in:
Richard Smith 2012-08-24 00:31:45 +00:00
parent d3511235d1
commit c621af1f60
1 changed files with 1 additions and 1 deletions

View File

@ -286,7 +286,7 @@ void ProfileEstimatorPass::recurseBasicBlock(BasicBlock *BB) {
}
}
double fraction = floor(BBWeight/Edges.size());
double fraction = Edges.size() ? floor(BBWeight/Edges.size()) : 0.0;
// Finally we know what flow is still not leaving the block, distribute this
// flow onto the empty edges.
for (SmallVector<Edge, 8>::iterator ei = Edges.begin(), ee = Edges.end();