diff options
author | nicolas.nardino <nicolas.nardino@ens-lyon.fr> | 2021-06-10 16:31:51 +0200 |
---|---|---|
committer | nicolas.nardino <nicolas.nardino@ens-lyon.fr> | 2021-06-10 16:31:51 +0200 |
commit | 1701e43316ee8e69e794a025a8c9979af6bb8c93 (patch) | |
tree | f489f1f3e7c90d04d47536e480cf2b49a0eb440c /scheduling/RTLpathScheduleraux.ml | |
parent | 386b9053177bb4ef2801cec00b717c400a828139 (diff) | |
download | compcert-kvx-1701e43316ee8e69e794a025a8c9979af6bb8c93.tar.gz compcert-kvx-1701e43316ee8e69e794a025a8c9979af6bb8c93.zip |
Work on new schedluer
Renamed a test file, wrote function to compute pressure deltas,
Still need to pass the info in some way; beginning of the actual
scheduler function
Diffstat (limited to 'scheduling/RTLpathScheduleraux.ml')
-rw-r--r-- | scheduling/RTLpathScheduleraux.ml | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/scheduling/RTLpathScheduleraux.ml b/scheduling/RTLpathScheduleraux.ml index 72cf6682..e04e7c23 100644 --- a/scheduling/RTLpathScheduleraux.ml +++ b/scheduling/RTLpathScheduleraux.ml @@ -94,7 +94,7 @@ let get_live_regs_entry (sb : superblock) code = match ins with | Inop _ -> regset | Iop (_, args, dest, _) - | Iload (_, _, _, args, dest, _) -> + | Iload (_, _, _, args, dest, _) -> List.fold_left (fun set reg -> Registers.Regset.add reg set) (Registers.Regset.remove dest regset) args | Istore (_, _, args, src, _) -> @@ -114,13 +114,20 @@ let get_live_regs_entry (sb : superblock) code = | Datatypes.Coq_inr _ -> regset) args | Ibuiltin (_, args, dest, _) -> - List.fold_left (fun set reg -> - match reg with - | AST.BA r -> Registers.Regset.add r set - | _ -> set) - (match dest with - | AST.BR r -> Registers.Regset.remove r regset - | _ -> regset) + List.fold_left (fun set arg -> + let rec add reg set = + match reg with + | AST.BA r -> Registers.Regset.add r set + | AST.BA_splitlong (hi, lo) + | AST.BA_addptr (hi, lo) -> add hi (add lo set) + | _ -> set + in add arg set) + (let rec rem dest set = + match dest with + | AST.BR r -> Registers.Regset.remove r set + | AST.BR_splitlong (hi, lo) -> rem hi (rem lo set) + | _ -> set + in rem dest regset) args | Icond (_, args, _, _, _) -> List.fold_left (fun set reg -> @@ -166,7 +173,8 @@ let schedule_superblock sb code = | Some s -> s | None -> Regset.empty)) (Array.sub sb.instructions 0 (nr_instr-trailer_length))) - live_regs_entry with + live_regs_entry + sb.typing with | None -> sb.instructions | Some order -> let ins' = |