diff --git a/bolt/lib/Passes/MCF.cpp b/bolt/lib/Passes/MCF.cpp index 4f3a964fd3230..38350efa2a730 100644 --- a/bolt/lib/Passes/MCF.cpp +++ b/bolt/lib/Passes/MCF.cpp @@ -153,7 +153,7 @@ void computeEdgeWeights(BinaryBasicBlock *BB, EdgeWeightMap &EdgeWeights) { E = GraphT::child_end(BB); CI != E; ++CI) { typename GraphT::NodeRef Child = *CI; - double Weight = 1 / (GraphT::child_end(BB) - GraphT::child_begin(BB)); + double Weight = 1.0 / (GraphT::child_end(BB) - GraphT::child_begin(BB)); if (TotalChildrenCount != 0.0) Weight = ChildrenExecCount[ChildIndex] / TotalChildrenCount; updateEdgeWeight(EdgeWeights, BB, Child, Weight);