Constant float arrays can now propagate their contents. This is sufficient for constant propagation but does not allow alias based optimisation:
type complex = { re: float; im: float }
let one = { re = 1.0; im = 0.0 }
let add x y = { re = x.re +. y.re; im = x.im +. y.im }
let two = add one one
let norm2 x = x.re *. x.re +. x.im *. x.im
let foo x =
let c = add x x in
norm2 c
two can be statically computed, but the intermediate allocation of c in foo cannot be eliminated.
To allow that float array approximation need to contain a Simple_value_approx.t instead of a float.
Constant float arrays can now propagate their contents. This is sufficient for constant propagation but does not allow alias based optimisation:
two
can be statically computed, but the intermediate allocation of c in foo cannot be eliminated. To allow that float array approximation need to contain aSimple_value_approx.t
instead of a float.