From 790161a565674a5f90bfefc11e5f2a07a73a9f6c Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 1 Dec 2020 15:25:30 +0100 Subject: Ignore loopback edges on tail-duplicate --- backend/Duplicateaux.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backend/Duplicateaux.ml') 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 -- cgit