Skip to content

Commit 6e33b8f

Browse files
authored
Merge pull request #463 from mshinwell/flambda2-flambda2-name-occurrences-diff
Speed up Name_occurrences.diff
2 parents 769af78 + fc91be9 commit 6e33b8f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

middle_end/flambda/compilenv_deps/patricia_tree.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ struct
11391139
let transpose_keys_and_data_set _ =
11401140
Misc.fatal_error "transpose_keys_and_data_set not yet implemented"
11411141

1142-
let diff_domains _ _ = Misc.fatal_error "diff_domains not yet implemented"
1142+
let diff_domains = diff
11431143

11441144
let fold2_stop_on_key_mismatch _ _ _ _ =
11451145
Misc.fatal_error "fold2_stop_on_key_mismatch not yet implemented"

middle_end/flambda/naming/name_occurrences.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,9 @@ end = struct
363363
if N.Map.is_empty map then Empty
364364
else Potentially_many map
365365
| Potentially_many map1, Potentially_many map2 ->
366-
let map =
367-
N.Map.fold (fun name _ map -> N.Map.remove name map)
368-
map2
369-
map1
370-
in
371-
Potentially_many map
366+
let map = N.Map.diff_domains map1 map2 in
367+
if N.Map.is_empty map then Empty
368+
else Potentially_many map
372369

373370
let union t1 t2 =
374371
match t1, t2 with

0 commit comments

Comments
 (0)