diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-03-01 14:43:59 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-03-01 15:32:32 +0100 |
commit | 9e2ee5801ae37e54dfac34f27ed2f07bbb8322d3 (patch) | |
tree | 68694cbcceb16d54e4f3cd2a6cf532f437468ea2 /kernel/nativecode.ml | |
parent | 38fa8db7bd81155deee36c0e5ff6730851a92286 (diff) |
Hunting pervasive equality in native compiler. It seems they were used for
optimization purposes. I replaced their use with the under-approximation
of pointer equality.
Diffstat (limited to 'kernel/nativecode.ml')
-rw-r--r-- | kernel/nativecode.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/nativecode.ml b/kernel/nativecode.ml index 99513319b..3be56b189 100644 --- a/kernel/nativecode.ml +++ b/kernel/nativecode.ml @@ -755,7 +755,9 @@ let rec insert cargs body rl = let params = rm_params fv params in rl:= Rcons(ref [(c,params)], fv, body, ref Rnil) | Rcons(l,fv,body',rl) -> - if Pervasives.(=) body body' then (** FIXME *) + (** ppedrot: It seems we only want to factorize common branches. It should + not matter to do so with a subapproximation by (==). *) + if body == body' then let (c,params) = cargs in let params = rm_params fv params in l := (c,params)::!l @@ -1159,7 +1161,7 @@ let optimize gdef l = let b2 = optimize s b2 in begin match t, b2 with | MLapp(MLprimitive Is_accu,[| l1 |]), MLmatch(annot, l2, _, bs) - when Pervasives.(=) l1 l2 -> MLmatch(annot, l1, b1, bs) (** FIXME *) + when l1 == l2 -> MLmatch(annot, l1, b1, bs) (** approximation *) | _, _ -> MLif(t, b1, b2) end | MLmatch(annot,a,accu,bs) -> |