mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Fix floating-point divide by zero, in a case where the value was not going to be used anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162518 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6211386799
commit
9e085a8637
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user