From 7bcf7240186f670786c9daba0ffff768c180fd83 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 16 Jul 2021 21:52:22 +0200 Subject: make operations cse3 parametric --- backend/CSE3.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'backend/CSE3.v') diff --git a/backend/CSE3.v b/backend/CSE3.v index 21067720..54a8a3bc 100644 --- a/backend/CSE3.v +++ b/backend/CSE3.v @@ -24,7 +24,9 @@ Axiom preanalysis : typing_env -> RTL.function -> invariants * analysis_hints. Record cse3params : Type := mkcse3params { cse3_conditions : bool; - cse3_trivial_ops : bool; + cse3_operations : bool; + cse3_loads : bool; + cse3_trivial_ops: bool; }. Section PARAMS. @@ -89,7 +91,7 @@ Definition param_transf_instr (fmap : PMap.t RB.t) match instr with | Iop op args dst s => let args' := subst_args fmap pc args in - match (if (negb params.(cse3_trivial_ops)) && (is_trivial_op op) + match (if (negb params.(cse3_operations) || ((negb params.(cse3_trivial_ops)) && (is_trivial_op op))) then None else find_op_in_fmap fmap pc op args') with | None => Iop op args' dst s | Some src => Iop Omove (src::nil) dst s @@ -144,6 +146,8 @@ End PARAMS. Definition cmdline_params (_ : unit) := {| cse3_conditions := Compopts.optim_CSE3_conditions tt; - cse3_trivial_ops := Compopts.optim_CSE3_trivial_ops tt |}. + cse3_operations := true; + cse3_loads := true; + cse3_trivial_ops:= Compopts.optim_CSE3_trivial_ops tt |}. Definition transf_program p := param_transf_program (cmdline_params tt) p. -- cgit