diff options
-rw-r--r-- | driver/Clflags.ml | 1 | ||||
-rw-r--r-- | driver/Driver.ml | 4 | ||||
-rw-r--r-- | kvx/lib/RTLpathScheduleraux.ml | 39 |
3 files changed, 25 insertions, 19 deletions
diff --git a/driver/Clflags.ml b/driver/Clflags.ml index eb21b3f8..fc5d9e45 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -36,6 +36,7 @@ let option_fredundancy = ref true let option_fduplicate = ref (-1) let option_finvertcond = ref true let option_ftracelinearize = ref false +let option_fprepass = ref false let option_fpostpass = ref true let option_fpostpass_sched = ref "list" let option_fifconversion = ref true diff --git a/driver/Driver.ml b/driver/Driver.ml index 90afb812..6accc22b 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -204,7 +204,8 @@ Processing options: -fcse3-glb Refine CSE3 information using greatest lower bounds [on] -fmove-loop-invariants Perform loop-invariant code motion [off] -fredundancy Perform redundancy elimination [on] - -fpostpass Perform postpass scheduling (only for K1 architecture) [on] + -fprepass Perform prepass scheduling (only for K1 architecture) [off] + -fpostpass Perform postpass scheduling (only for K1 architecture) [on] -fpostpass= <optim> Perform postpass scheduling with the specified optimization [list] (<optim>=list: list scheduling, <optim>=ilp: ILP, <optim>=greedy: just packing bundles) -fduplicate <nb_nodes> Perform tail duplication to form superblocks on predicted traces @@ -419,6 +420,7 @@ let cmdline_actions = @ f_opt "cse3-glb" option_fcse3_glb @ f_opt "move-loop-invariants" option_fmove_loop_invariants @ f_opt "redundancy" option_fredundancy + @ f_opt "prepass" option_fprepass @ f_opt "postpass" option_fpostpass @ [ Exact "-fduplicate", Integer (fun n -> option_fduplicate := n) ] @ f_opt "invertcond" option_finvertcond diff --git a/kvx/lib/RTLpathScheduleraux.ml b/kvx/lib/RTLpathScheduleraux.ml index 3008543c..32fb2c2a 100644 --- a/kvx/lib/RTLpathScheduleraux.ml +++ b/kvx/lib/RTLpathScheduleraux.ml @@ -95,24 +95,27 @@ end (* TODO David *) let schedule_superblock sb code = - let old_flag = !debug_flag in - debug_flag := true; - print_endline "ORIGINAL SUPERBLOCK"; - print_superblock sb code; - debug_flag := old_flag; - match PrepassSchedulingOracle.schedule_sequence - (Array.map (fun i -> - match PTree.get i code with Some ii -> ii | None -> failwith "RTLpathScheduleraux.schedule_superblock") - sb.instructions) with - | None -> sb.instructions - | Some order -> - let ins' = Array.map (fun i -> sb.instructions.(i)) order in - Printf.printf "REORDERED SUPERBLOCK %d\n" (Array.length ins'); - debug_flag := true; - print_instructions (Array.to_list ins') code; - debug_flag := old_flag; - (*sb.instructions; *) - ins';; + if not !Clflags.option_fprepass + then sb.instructions + else + let old_flag = !debug_flag in + debug_flag := true; + print_endline "ORIGINAL SUPERBLOCK"; + print_superblock sb code; + debug_flag := old_flag; + match PrepassSchedulingOracle.schedule_sequence + (Array.map (fun i -> + match PTree.get i code with Some ii -> ii | None -> failwith "RTLpathScheduleraux.schedule_superblock") + sb.instructions) with + | None -> sb.instructions + | Some order -> + let ins' = Array.map (fun i -> sb.instructions.(i)) order in + Printf.printf "REORDERED SUPERBLOCK %d\n" (Array.length ins'); + debug_flag := true; + print_instructions (Array.to_list ins') code; + debug_flag := old_flag; + (*sb.instructions; *) + ins';; (* stub2: reverse function *) (* |