aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-03-09 15:16:08 +0100
committerCyril SIX <cyril.six@kalray.eu>2020-03-09 15:16:08 +0100
commitb016de5a1a8230b5a6c51d8e7cd8829d39a4c781 (patch)
treeda167bb86a5eba736db551df7df613eb5201a30c /backend/Duplicateaux.ml
parentec0d767ba602c35e320ee77f2ccd6f513adeb7b6 (diff)
downloadcompcert-kvx-b016de5a1a8230b5a6c51d8e7cd8829d39a4c781.tar.gz
compcert-kvx-b016de5a1a8230b5a6c51d8e7cd8829d39a4c781.zip
[BROKEN] Replacing the boolean -fduplicate option by an integer
To control the threshold for duplication
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r--backend/Duplicateaux.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 05b8ddb8..636a8d8e 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -467,7 +467,7 @@ let tail_duplicate code preds ptree trace =
in (new_code, new_ptree, !nb_duplicated)
let superblockify_traces code preds traces =
- let max_nb_duplicated = 1 (* FIXME - should be architecture dependent *)
+ let max_nb_duplicated = !Clflags.option_fduplicate (* FIXME - should be architecture dependent *)
in let ptree = make_identity_ptree code
in let rec f code ptree = function
| [] -> (code, ptree, 0)
@@ -499,12 +499,14 @@ let rec invert_iconds code = function
else code
in invert_iconds code' ts
-(* For now, identity function *)
let duplicate_aux f =
let entrypoint = f.fn_entrypoint in
let code = f.fn_code in
let traces = select_traces (to_ttl_code code entrypoint) entrypoint in
let icond_code = invert_iconds code traces in
let preds = get_predecessors_rtl icond_code in
- let (new_code, pTreeId) = ((* print_traces traces; *) superblockify_traces icond_code preds traces) in
- ((new_code, f.fn_entrypoint), pTreeId)
+ if !Clflags.option_fduplicate >= 1 then
+ let (new_code, pTreeId) = ((* print_traces traces; *) superblockify_traces icond_code preds traces) in
+ ((new_code, f.fn_entrypoint), pTreeId)
+ else
+ ((icond_code, entrypoint), make_identity_ptree code)