Project

General

Profile

Revision 79614a15 src/optimize_machine.ml

View differences:

src/optimize_machine.ml
16 16
open Machine_code 
17 17
open Dimension
18 18

  
19
(* Some optimizations may yield denormalized values. Similar to normalize_expr *)
20
(*
21
let normalize_value v =
22
  let rec norm_cst offset cst =
23
    match cst, offset with
24
    | Const_int   _   , _
25
    | Const_real  _   , _ 
26
    | Const_float _   , _          -> cst
27
    | Const_array args, Index i::q -> if Dimension.is_dimension_const 
28
    | Const_tag of label
29
    | Const_string of string (* used only for annotations *)
30
    | Const_struct of (label * constant) list
31
  let rec norm_value offset v =
32
    match v with
33
    | Cst _ 
34
    | LocalVar _
35
    | StateVar _ -> v
36
    | Fun (id, args) -> Fun (id, List.map normalize_value args)
37
    | Array args -> Array List.map normalize_value args
38
    | Access of value_t * value_t
39
    | Power of value_t * value_t
40
  in norm [] v
41
*)
19 42
let pp_elim fmt elim =
20 43
  begin
21 44
    Format.fprintf fmt "{ /* elim table: */@.";

Also available in: Unified diff