Skip to content

Fix prove/meet mixup in simplify_phys_equal #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions middle_end/flambda2/simplify/simplify_binary_primitive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -857,16 +857,13 @@ let simplify_phys_equal (op : P.equality_comparison) dacc ~original_term dbg
match op with Eq -> const true | Neq -> const false
else
let typing_env = DA.typing_env dacc in
let proof1 = T.meet_equals_tagged_immediates typing_env arg1_ty in
let proof2 = T.meet_equals_tagged_immediates typing_env arg2_ty in
let proof1 = T.prove_equals_tagged_immediates typing_env arg1_ty in
let proof2 = T.prove_equals_tagged_immediates typing_env arg2_ty in
match proof1, proof2 with
| Known_result _, Known_result _ ->
| Proved _, Proved _ ->
Binary_int_eq_comp_tagged_immediate.simplify op dacc ~original_term dbg
~arg1 ~arg1_ty ~arg2 ~arg2_ty ~result_var
| Known_result _, (Need_meet | Invalid)
| (Need_meet | Invalid), Known_result _
| Need_meet, (Need_meet | Invalid)
| Invalid, (Need_meet | Invalid) ->
| Unknown, Unknown | Proved _, Unknown | Unknown, Proved _ ->
let dacc =
DA.add_variable dacc result_var
(T.these_naked_immediates Targetint_31_63.all_bools)
Expand Down