Rec_info: Add coercions#317
Closed
lukemaurer wants to merge 17 commits intoocaml-flambda:flambda2.0-stablefrom
Closed
Rec_info: Add coercions#317lukemaurer wants to merge 17 commits intoocaml-flambda:flambda2.0-stablefrom
lukemaurer wants to merge 17 commits intoocaml-flambda:flambda2.0-stablefrom
Conversation
* Use `Coercion.t` rather than `Coercion.t option` in many places * Use `Rec_info.t` again where sensible (in making inlining decisions, for instance), but redefine it as `unit` pending the next phase of `Rec_info` overhaul * Add simple `int` fields to `Coercion.t` for changing recursion depth; this is simpler than what we'll actually need but specific enough that we can test meaningfully (e.g., we can tell whether coercions are composed in the right order)
bea20c4 to
29b5420
Compare
poechsel
reviewed
Mar 17, 2021
| [@@@ocaml.warning "+a-4-30-40-41-42"] | ||
|
|
||
| (* CR lmaurer: Maybe we should similarly have a type [canonical] isomorphic | ||
| to [Simple.t]? *) |
There was a problem hiding this comment.
I honestly think it would be a nice thing to document this file a bit more. Right now it's hard to understand what [canonical] and [coercion] means in this context. Both terms are used extensively but are never introduced properly. It would also be good to explain the link between coercions and rec_info.
Author
There was a problem hiding this comment.
Added a few (long) comments. There isn't really yet a link between coercions and rec_info, and even once the rec_info patch is in, the connection will simply be that changing rec_info is a variety of coercion (that just happens to be currently the only nontrivial one).
Also return Bottom from more places (generally anything involved in a meet).
b851101 to
9816841
Compare
Author
A `Name.Set.t` or `'a Name.Map.t` is a fine thing, but a `Simple.Set.t` or `'a Simple.Map.t` is much sketchier, since whether we want to treat two simples that differ only in `Rec_info.t` as equivalent depends on context. Fortunately, we usually just need a set or map of names. The one place where this gets tricky is in the uses of `Aliases.get_alias`, so there's now `Aliases.Alias_set.t` to encapsulate the needed operations.
Everything is now gone except for a few stragglers in `cmx/` and `naming/`; these will be more easily dealt with after some changes to `Simple.t`.
request-checks: true
Author
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.
This is xclerc's work; making a PR to review it.
Add the Coercion constructor for simple expressions. So far, only the identity coercion exists, but part 2 of this line of work will add coercions that express that two bindings might refer to the same function but at different recursion depths (which we'll be tracking in the type).