diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-10 16:18:19 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-10 16:18:19 +0200 |
commit | eda50ef26e8799eaa928edb01038775057874068 (patch) | |
tree | bca2aeafd0357e04b4b64cd36d10fb830e37b71c | |
parent | eafda94d27cb246c1614b51d75d32931a58d9b31 (diff) | |
download | compcert-kvx-eda50ef26e8799eaa928edb01038775057874068.tar.gz compcert-kvx-eda50ef26e8799eaa928edb01038775057874068.zip |
use scheduler_by_name
-rw-r--r-- | kvx/InstructionScheduler.ml | 7 | ||||
-rw-r--r-- | kvx/InstructionScheduler.mli | 3 | ||||
-rw-r--r-- | kvx/PostpassSchedulingOracle.ml | 10 |
3 files changed, 11 insertions, 9 deletions
diff --git a/kvx/InstructionScheduler.ml b/kvx/InstructionScheduler.ml index d72e38b7..eab0b21a 100644 --- a/kvx/InstructionScheduler.ml +++ b/kvx/InstructionScheduler.ml @@ -1254,3 +1254,10 @@ let cascaded_scheduler (problem : problem) = end; Some solution;; +let scheduler_by_name name = + match name with + | "ilp" -> validated_scheduler cascaded_scheduler + | "list" -> validated_scheduler list_scheduler + | "revlist" -> validated_scheduler reverse_list_scheduler + | "greedy" -> greedy_scheduler + | s -> failwith ("unknown scheduler: " ^ s);; diff --git a/kvx/InstructionScheduler.mli b/kvx/InstructionScheduler.mli index f91c2d06..85e2a5c6 100644 --- a/kvx/InstructionScheduler.mli +++ b/kvx/InstructionScheduler.mli @@ -108,3 +108,6 @@ val smt_print_problem : out_channel -> problem -> unit;; val ilp_print_problem : out_channel -> problem -> pseudo_boolean_problem_type -> pseudo_boolean_mapper;; val ilp_scheduler : pseudo_boolean_problem_type -> problem -> solution option;; + +(** Schedule a problem using a scheduler given by a string name *) +val scheduler_by_name : string -> problem -> int array option;; diff --git a/kvx/PostpassSchedulingOracle.ml b/kvx/PostpassSchedulingOracle.ml index 2326f97e..2107ce22 100644 --- a/kvx/PostpassSchedulingOracle.ml +++ b/kvx/PostpassSchedulingOracle.ml @@ -921,15 +921,7 @@ let print_schedule sched = let do_schedule bb = let problem = build_problem bb in (if debug then 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 + let solution = scheduler_by_name (!Clflags.option_fpostpass_sched) problem in match solution with | None -> failwith "Could not find a valid schedule" | Some sol -> |