Skip to content

Commit

Permalink
flambda-backend: Take into account witnesses when computing [lessequa…
Browse files Browse the repository at this point in the history
…l] on values (#2402)

otherwise we lose witnesses sometimes
  • Loading branch information
gretay-js authored Mar 28, 2024
1 parent fc7bf14 commit 22c805d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lambda/assume_info.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Witnesses = struct
type t = unit

let join _ _ = ()
let lessequal _ _ = true
let meet _ _ = ()
let print _ _ = ()
let empty = ()
Expand Down
1 change: 1 addition & 0 deletions lambda/assume_info.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Witnesses : sig

val join : t -> t -> t
val meet : t -> t -> t
val lessequal : t -> t -> bool
val print : Format.formatter -> t -> unit
val compare : t -> t -> int
end
Expand Down
4 changes: 3 additions & 1 deletion utils/zero_alloc_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module type WS = sig

val meet : t -> t -> t

val lessequal : t -> t -> bool

val print : Format.formatter -> t -> unit

val compare : t -> t -> int
Expand Down Expand Up @@ -39,7 +41,7 @@ module Make (Witnesses : WS) = struct
match v1, v2 with
| Bot, Bot -> true
| Safe, Safe -> true
| Top _, Top _ -> true
| Top w1, Top w2 -> Witnesses.lessequal w1 w2
| Bot, Safe -> true
| Bot, Top _ -> true
| Safe, Top _ -> true
Expand Down
2 changes: 2 additions & 0 deletions utils/zero_alloc_utils.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module type WS = sig

val meet : t -> t -> t

val lessequal : t -> t -> bool

val print : Format.formatter -> t -> unit

val compare : t -> t -> int
Expand Down

0 comments on commit 22c805d

Please sign in to comment.