diff options
-rw-r--r-- | backend/CSE3analysisaux.ml | 8 | ||||
-rw-r--r-- | driver/Driver.ml | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/backend/CSE3analysisaux.ml b/backend/CSE3analysisaux.ml index 8229a76d..2e7d7063 100644 --- a/backend/CSE3analysisaux.ml +++ b/backend/CSE3analysisaux.ml @@ -24,8 +24,7 @@ let string_of_chunk = function let print_reg channel i = Printf.fprintf channel "r%d" i;; -let print_eq channel id (lhs, sop, args) = - Printf.printf "%d: " id; +let print_eq channel (lhs, sop, args) = match sop with | SOp op -> Printf.printf "%a = %a\n" print_reg lhs (PrintOp.print_operation print_reg) (op, args) @@ -50,13 +49,14 @@ let preanalysis (f : RTL.coq_function) = let mutating_eq_find_oracle node eq : P.t option = let (flat_eq_lhs, flat_eq_op, flat_eq_args) as flat_eq = flatten_eq eq in match Hashtbl.find_opt eq_table flat_eq with - | Some x -> Some x + | Some x -> + Some x | None -> + (* FIXME print_eq stderr flat_eq; *) incr cur_eq_id; let id = !cur_eq_id in let coq_id = P.of_int id in begin - print_eq stderr id flat_eq; Hashtbl.add eq_table flat_eq coq_id; Hashtbl.add rhs_table (flat_eq_op, flat_eq_args) (PSet.add coq_id diff --git a/driver/Driver.ml b/driver/Driver.ml index db71aef9..6f32fc33 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -196,6 +196,7 @@ Processing options: (<n>=0: none, <n>=1: limited, <n>=2: full; default is full) -fcse Perform common subexpression elimination [on] -fcse2 Perform inter-loop common subexpression elimination [on] + -fcse3 Perform inter-loop common subexpression elimination [on] -fredundancy Perform redundancy elimination [on] -fpostpass Perform postpass scheduling (only for K1 architecture) [on] -fpostpass= <optim> Perform postpass scheduling with the specified optimization [list] @@ -265,7 +266,7 @@ let dump_mnemonics destfile = let optimization_options = [ option_ftailcalls; option_fifconversion; option_fconstprop; - option_fcse; option_fcse2; + option_fcse; option_fcse2; option_fcse3; option_fpostpass; option_fredundancy; option_finline; option_finline_functions_called_once; ] @@ -391,6 +392,7 @@ let cmdline_actions = @ f_opt "const-prop" option_fconstprop @ f_opt "cse" option_fcse @ f_opt "cse2" option_fcse2 + @ f_opt "cse3" option_fcse3 @ f_opt "redundancy" option_fredundancy @ f_opt "postpass" option_fpostpass @ f_opt "duplicate" option_fduplicate |