Distinguish all-float blocks and float arrays#61
Merged
stedolan merged 2 commits intooxcaml:4.11from Jul 19, 2021
Merged
Conversation
stedolan
reviewed
Jun 29, 2021
middle_end/closure/closure.ml
Outdated
| | Const_block (tag, fields) -> | ||
| str (Uconst_block (tag, List.map transl fields)) | ||
| | Const_float_block sl -> | ||
| (* CR mshinwell: Add [Uconst_float_block]? *) |
Contributor
There was a problem hiding this comment.
I don't think there's any real need to do this. I don't think Clambda needs to distinguish the two, and if one day it needs to it's easily changed then.
Collaborator
Author
There was a problem hiding this comment.
This was a stale CR, removed.
| | Pmakearray(_, _) when is_empty approxs -> | ||
| Prim (Pmakeblock(0, Asttypes.Immutable, Some []), [], dbg), | ||
| A.value_block (Tag.create_exn 0) [||], C.Benefit.zero | ||
| (* CR mshinwell: Work out what to do here with [Pmakefloatblock] *) |
Contributor
There was a problem hiding this comment.
Do you plan something more complicated than treating it the same as Pfloatarray here?
Collaborator
Author
There was a problem hiding this comment.
No, this was also a stale CR. Flambda 1 uses the Clambda primitives in its IR, so in fact it never sees Pmakefloatblock here, as Convert_primitives has turned it into Pmakearray Pfloatarray.
stedolan
approved these changes
Jul 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flambda 2 has a strict distinction between blocks (including records) and arrays. At first we tried to treat these together but that proved to be a bad idea.
One of the changes required to the frontend to enforce this distinction is given here. It distinguishes all-float records from float arrays. The change to
Lambda.structured_constantnecessitated a bootstrap.