diff options
Diffstat (limited to 'scheduling/RTLpathScheduleraux.ml')
-rw-r--r-- | scheduling/RTLpathScheduleraux.ml | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scheduling/RTLpathScheduleraux.ml b/scheduling/RTLpathScheduleraux.ml index 9c3ff689..8df3edbc 100644 --- a/scheduling/RTLpathScheduleraux.ml +++ b/scheduling/RTLpathScheduleraux.ml @@ -72,7 +72,7 @@ let get_superblocks code entry pm typing = lsb end -(** the useful one. Returns a hashtable with bindings of form +(** the useful one. Returns a hashtable with bindings of shape ** [(r,(t, n)], where [r] is a pseudo-register (Registers.reg), ** [t] is its class (according to [typing]), and [n] the number of ** times it's referenced as an argument in instructions of [seqa] ; @@ -85,7 +85,7 @@ let reference_counting (seqa : (instruction * Regset.t) array) let retl = Hashtbl.create 42 in let retr = Array.make (Array.length seqa) [] in (* retr.(i) : (r, b) -> (r', b') -> ... - where b = true if seen as arg, false if seen as dest + * where b = true if seen as arg, false if seen as dest *) List.iter (fun reg -> Hashtbl.add retl @@ -118,7 +118,7 @@ let reference_counting (seqa : (instruction * Regset.t) array) (dest,false)::(reg, true)::(map_true args) | _ -> (dest,false)::(map_true args)) - | Itailcall(_,fn,args) -> + | Itailcall(_,fn,args) -> List.iter (add_reg) args; retr.(i) <- (match fn with | Datatypes.Coq_inl reg -> @@ -146,6 +146,20 @@ let reference_counting (seqa : (instruction * Regset.t) array) retr.(i) <- [reg, true] | _ -> () ) seqa; + print_string "mentions\n"; + Array.iteri (fun i l -> + print_int i; + print_string ": ["; + List.iter (fun (r, b) -> + print_int (Camlcoq.P.to_int r); + print_string ":"; + print_string (if b then "a:" else "d"); + if b then print_int (snd (Hashtbl.find retl r)); + print_string ", " + ) l; + print_string "]\n"; + flush stdout; + ) retr; retl, retr |