Correct erroneous comment
parent
e04669ee7b
commit
a03208565a
|
@ -431,16 +431,16 @@ module Whether_sufficient_benefit = struct
|
||||||
float (t.evaluated_benefit + lifting_benefit)
|
float (t.evaluated_benefit + lifting_benefit)
|
||||||
end else begin
|
end else begin
|
||||||
(* The estimated benefit is the evaluated benefit times an
|
(* The estimated benefit is the evaluated benefit times an
|
||||||
estimation of the probability that the branch does not matter
|
estimation of the probability that the branch does actually matter
|
||||||
for performances (is cold). The probability is very roughtly
|
for performance (i.e. is hot). The probability is very roughly
|
||||||
estimated by considering that for every branching the
|
estimated by considering that under every branch the
|
||||||
sub-expressions has the same [1 / (1 + factor)] probability
|
sub-expressions have the same [1 / (1 + factor)] probability
|
||||||
[p] of being cold. Hence the probability for the current
|
[p] of being hot. Hence the probability for the current
|
||||||
call to be cold is [p ^ number of nested branch].
|
call to be hot is [p ^ number of nested branches].
|
||||||
The probability is expressed as [1 / (1 + factor)] rather
|
The probability is expressed as [1 / (1 + factor)] rather
|
||||||
than letting the user directly provide [p], since for every
|
than letting the user directly provide [p], since for every
|
||||||
positive value of [factor] [p] is in [0, 1]. *)
|
positive value of [factor] [p] is in [0, 1]. *)
|
||||||
let branch_never_taken_estimated_probability =
|
let branch_taken_estimated_probability =
|
||||||
let inline_branch_factor =
|
let inline_branch_factor =
|
||||||
let factor =
|
let factor =
|
||||||
Clflags.Float_arg_helper.get ~key:t.round
|
Clflags.Float_arg_helper.get ~key:t.round
|
||||||
|
@ -457,9 +457,9 @@ module Whether_sufficient_benefit = struct
|
||||||
1. /. (1. +. inline_branch_factor)
|
1. /. (1. +. inline_branch_factor)
|
||||||
in
|
in
|
||||||
let call_estimated_probability =
|
let call_estimated_probability =
|
||||||
branch_never_taken_estimated_probability ** float t.branch_depth
|
branch_taken_estimated_probability ** float t.branch_depth
|
||||||
in
|
in
|
||||||
float t.evaluated_benefit *. call_estimated_probability
|
float t.evaluated_benefit *. call_estimated_probability
|
||||||
end
|
end
|
||||||
|
|
||||||
let evaluate t =
|
let evaluate t =
|
||||||
|
|
Loading…
Reference in New Issue