Changeset 2742


Ignore:
Timestamp:
Feb 27, 2013, 5:42:59 PM (7 years ago)
Author:
sacerdot
Message:

Untrusted register colouring fully branched.

Location:
extracted
Files:
2 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • extracted/untrusted/build.ml

    r2740 r2742  
    44open Untrusted_interference
    55
    6 let build globals int_fun liveafter =
     6let build globals int_fun uses liveafter =
    77
    88  (* Create an interference graph whose vertices are the procedure's
    99     pseudo-registers. This graph initially has no edges. *)
    1010
    11   (*CSC: we are not precise here, we take all the pseudoregisters in the
    12     universe; we could compute the set by iteration over the code *)
    1311  let f_locals =
    14    let first_fresh = int_fun.Joint.joint_if_luniverse in
    15    let rec aux n =
    16     if Positive.eqb0 n first_fresh = Bool.True then
    17      Pset.empty
    18     else
    19      Pset.add n (aux (Positive.succ n))
    20    in
    21     aux Positive.One in
     12   Identifiers.foldi0 PreIdentifiers.RegisterTag
     13    (fun id _ map -> Pset.add id map
     14    ) uses Pset.empty in
    2215
    2316  let graph = create f_locals in
  • extracted/untrusted/build.mli

    r2740 r2742  
    99 AST.ident List.list ->
    1010  Joint.joint_internal_function ->
    11    Fixpoints.valuation ->
    12     Untrusted_interference.graph
     11   Positive.pos Identifiers.identifier_map ->
     12    Fixpoints.valuation ->
     13     Untrusted_interference.graph
  • extracted/untrusted/compute_colouring.ml

    r2740 r2742  
    55     it. Define a function that allows consulting the coloring. *)
    66
     7  let uses = Uses.examine_internal globals int_fun in
     8
    79  let module G = struct
    8     let graph = Build.build globals int_fun liveafter
    9     let uses = Uses.examine_internal int_fun
     10    let graph = Build.build globals int_fun uses liveafter
     11    let uses =
     12     (fun r ->
     13       Glue.int_of_matitapos
     14        (Identifiers.lookup_safe PreIdentifiers.RegisterTag uses r))
    1015    let verbose = false
    1116(*
  • extracted/untrusted/glue.ml

    r2740 r2742  
    1111    aux 1 (Vector.reverse0 Nat.O v)
    1212
     13let rec int_of_matitapos =
     14 function
     15   Positive.One -> 1
     16 | Positive.P0 v -> int_of_matitapos v * 2
     17 | Positive.P1 v -> int_of_matitapos v * 2 + 1
     18
    1319let option_of_matitaoption =
    1420 function
  • extracted/untrusted/glue.mli

    r2740 r2742  
    11val int_of_bitvector : BitVector.bitVector -> int
     2
     3val int_of_matitapos : Positive.pos -> int
    24
    35val option_of_matitaoption: 'a Types.option -> 'a option
Note: See TracChangeset for help on using the changeset viewer.