aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-12-01 15:25:30 +0100
committerCyril SIX <cyril.six@kalray.eu>2020-12-01 15:25:30 +0100
commit790161a565674a5f90bfefc11e5f2a07a73a9f6c (patch)
treebd119df8fe2a5dc0cfca3005f8db9273d197e8be /backend/Duplicateaux.ml
parent43a7cc2a7305395b20d92b240362ddfdb43963ff (diff)
downloadcompcert-kvx-790161a565674a5f90bfefc11e5f2a07a73a9f6c.tar.gz
compcert-kvx-790161a565674a5f90bfefc11e5f2a07a73a9f6c.zip
Ignore loopback edges on tail-duplicate
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r--backend/Duplicateaux.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 76b5616b..8436863a 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -546,6 +546,7 @@ let is_a_nop code n =
* ptree: the revmap
* trace: the trace to follow tail duplication on *)
let tail_duplicate code preds ptree trace =
+ debug "Tail_duplicate on that trace: %a\n" print_trace trace;
(* next_int: unused integer that can be used for the next duplication *)
let next_int = ref (next_free_pc code)
(* last_node and last_duplicate store resp. the last processed node of the trace, and its duplication *)
@@ -561,6 +562,7 @@ let tail_duplicate code preds ptree trace =
else
let node_preds = ptree_get_some n preds
in let node_preds_nolast = List.filter (fun e -> e <> get_some !last_node) node_preds
+ in let node_preds_nolast = List.filter (fun e -> not @@ List.mem e t) node_preds_nolast
in let final_node_preds = match !last_duplicate with
| None -> node_preds_nolast
| Some n' -> n' :: node_preds_nolast