Inlining misses some simple simplifications #5580
Original bug ID: 5580
Consider this program:
type t = False | True
x should be assigned the constant True but ocamlopt generates a runtime comparison (true != false) to decide the result of of_bool.
Closure.simplif_prim_pure receives the arguments
p = Pintcomp Cneq
If both approximations were Value_integer the comparison would be simplified.
If I change simplif_prim_pure to add a case matching [Value_constptr x; Value_integer y] similarly to [Value_integer x; Value_integer y] code generation improves. I don't understand the compiler well enough to know if that is the correct solution.
The text was updated successfully, but these errors were encountered: