diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-01 10:40:20 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-01 10:40:20 +0200 |
commit | 93604827233bc337f4235b1feb2c48b4a917d386 (patch) | |
tree | e53e50d7151482df159dd75823cc2a950c9f5168 /kvx/PostpassSchedulingOracle.ml | |
parent | df762ec07599897bac9800396b09cf1801f2db3c (diff) | |
download | compcert-kvx-93604827233bc337f4235b1feb2c48b4a917d386.tar.gz compcert-kvx-93604827233bc337f4235b1feb2c48b4a917d386.zip |
"nop" is not even printed out and thus uses no resources
Diffstat (limited to 'kvx/PostpassSchedulingOracle.ml')
-rw-r--r-- | kvx/PostpassSchedulingOracle.ml | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/kvx/PostpassSchedulingOracle.ml b/kvx/PostpassSchedulingOracle.ml index 822c0dc0..484903c7 100644 --- a/kvx/PostpassSchedulingOracle.ml +++ b/kvx/PostpassSchedulingOracle.ml @@ -504,8 +504,7 @@ let alu_lite_y : int array = let resmap = fun r -> match r with | Rissue -> 3 | Rtiny -> 1 | Rlite -> 1 | _ -> 0 in Array.of_list (List.map resmap resource_names) -let alu_nop : int array = let resmap = fun r -> match r with - | Rissue -> 1 | Rnop -> 1 | _ -> 0 +let alu_nop : int array = let resmap = fun r -> 0 in Array.of_list (List.map resmap resource_names) let alu_tiny : int array = let resmap = fun r -> match r with @@ -914,19 +913,28 @@ let print_bb oc bb = let asm_instructions = Asm.unfold_bblock bb in List.iter (print_inst oc) asm_instructions +let print_schedule sched = + print_string "[ "; + Array.iter (fun x -> Printf.printf "%d; " x) sched; + print_endline "]";; + let do_schedule bb = - let problem = build_problem bb - in let solution = (if !Clflags.option_fpostpass_sched = "ilp" then - validated_scheduler cascaded_scheduler - else if !Clflags.option_fpostpass_sched = "list" then - validated_scheduler list_scheduler - else if !Clflags.option_fpostpass_sched = "revlist" then - validated_scheduler reverse_list_scheduler - else if !Clflags.option_fpostpass_sched = "greedy" then - greedy_scheduler else failwith ("Invalid scheduler:" ^ !Clflags.option_fpostpass_sched)) problem + let problem = build_problem bb in + print_problem stdout problem; + let solution = (match !Clflags.option_fpostpass_sched with + | "ilp" -> + validated_scheduler cascaded_scheduler + | "list" -> + validated_scheduler list_scheduler + | "revlist" -> + validated_scheduler reverse_list_scheduler + | "greedy" -> greedy_scheduler + | other -> failwith ("Invalid scheduler:" ^ other)) problem in match solution with | None -> failwith "Could not find a valid schedule" - | Some sol -> let bundles = bundlize_solution bb sol in + | Some sol -> + ((if debug then print_schedule sol); + let bundles = bundlize_solution bb sol in (if debug then begin Printf.eprintf "Scheduling the following group of instructions:\n"; @@ -935,7 +943,7 @@ let do_schedule bb = List.iter (print_bb stderr) bundles; Printf.eprintf "--------------------------------\n" end; - bundles) + bundles)) (** * Dumb schedule if the above doesn't work |