diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-12-02 15:36:17 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-12-02 15:36:17 +0100 |
commit | abae3de5118a4741ae1c2350a3e75b6e0a84a57d (patch) | |
tree | 96f5559905454b66192e84e75c7a63ac70b91ee5 /backend/Duplicateaux.ml | |
parent | ed8aec9f9fb259fe218d2d29efa3c8cc85ef93f1 (diff) | |
download | compcert-kvx-abae3de5118a4741ae1c2350a3e75b6e0a84a57d.tar.gz compcert-kvx-abae3de5118a4741ae1c2350a3e75b6e0a84a57d.zip |
Slight perf improvement
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r-- | backend/Duplicateaux.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 55414f40..4684d870 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -724,7 +724,7 @@ let rtl_successors_pref = function let rec find_last_node_before_loop code node trace is_loop_header = let rtl_succ = rtl_successors @@ get_some @@ PTree.get node code in let headers = List.filter (fun n -> - get_some @@ PTree.get n is_loop_header && List.mem n trace) rtl_succ in + get_some @@ PTree.get n is_loop_header && HashedSet.PSet.contains trace n) rtl_succ in match headers with | [] -> ( match (rtl_successors_pref @@ get_some @@ PTree.get node code) with @@ -760,8 +760,8 @@ let get_inner_loops f code is_loop_header = debug "HEADPREDS: %a\n" print_intlist head_preds; filtered end in - let body = HashedSet.PSet.elements body in let sb_final = find_last_node_before_loop code head body is_loop_header in + let body = HashedSet.PSet.elements body in { preds = preds; body = body; head = head; finals = finals; sb_final = sb_final; } ) |