Repository navigation
Fix block preallocation and finer value block desc comparison - #4
Conversation
|
The The code in The code in |
Comment by @lthls: The code in Simple_value_approx was intentionally dropping block descriptions when encountering blocks with the same contents but different descriptions. This was meant to keep optimisations that share identical blocks (so that adding introspection would not degrade performance). But I think it was actually misguided: this code isn't involved in constant sharing, only when merging approximations coming from different branches (it should have been called join, not meet, but that's another story). I don't know if it matters in practice: I think that we can only get matching tags and sizes but mismatched descriptions when GADTs are involved, and in that case it's probably fine to lose the approximation. So I think we can keep your patch (at least when introspection is enabled).
d37f641 to
ebf7ea9
Compare
|
Thanks for your quick feedback. I have dropped the I will make a new release asap including your flambda changes. |
This PR implements two changes.
First a bug fix in
Cmm_helpers.preallocate_blockwhich dropped block descriptions.In particular, this broke cyclic constants:
The second fix is an attempt at making optimization passes "block_desc"-aware, but I am not sure whether this is a good idea or not.
@lthls: If you have some time to spare, I would be grateful if you could take a look ;)