[sledge] Strengthen simplification of Convert exps

Summary: Omit casts when source and destination types are equal.

Reviewed By: mbouaziz

Differential Revision: D14495814

fbshipit-source-id: 21bcfb6ab
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent ff9d3aca5a
commit 3a01feb9ba

@ -654,6 +654,7 @@ let float data = Float {data} |> check invariant
let simp_convert signed (dst : Typ.t) src arg =
match (dst, arg) with
| _ when Typ.equal dst src -> arg
| Integer {bits= m}, Integer {data; typ= Integer {bits= n}} ->
integer (Z.clamp ~signed (min m n) data) dst
| _ -> App {op= Convert {signed; dst; src}; arg}

Loading…
Cancel
Save