Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CSE tail recursive #1

Merged
merged 1 commit into from
Apr 21, 2021
Merged

Conversation

mshinwell
Copy link
Collaborator

As per #9636 upstream.
(Code review by David Allsopp)

@mshinwell mshinwell force-pushed the 4.11 branch 4 times, most recently from d9886b0 to 3f44c2c Compare December 23, 2020 15:32
@mshinwell mshinwell force-pushed the 4.11 branch 6 times, most recently from 2eaced5 to 4564823 Compare February 17, 2021 16:43
@mshinwell mshinwell force-pushed the 4.11 branch 2 times, most recently from 7e986a7 to c00ca0e Compare February 23, 2021 17:49
(Code review by David Allsopp)
@mshinwell
Copy link
Collaborator Author

#9636 hasn't yet been accepted upstream, but this version of the code has been reviewed.

Copy link
Collaborator

@lpw25 lpw25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change seems correct. I guess we might worry about the performance cost. Although I don't remember ever seeing CSE showing up as a hotspot in a profile, so it's probably fine.

@mshinwell
Copy link
Collaborator Author

Yeah, I agree.

@mshinwell mshinwell merged commit 0ae5245 into ocaml-flambda:4.11 Apr 21, 2021
mshinwell referenced this pull request in mshinwell/flambda-backend May 17, 2021
poechsel pushed a commit to poechsel/flambda-backend that referenced this pull request May 26, 2021
poechsel pushed a commit to poechsel/flambda-backend that referenced this pull request May 27, 2021
poechsel pushed a commit that referenced this pull request Jun 28, 2021
poechsel pushed a commit that referenced this pull request Jun 29, 2021
goldfirere pushed a commit that referenced this pull request May 5, 2023
* Fix ghost locations in modular extension AST nodes

* Add missing ghostification

Thank you, Carl!

* Comment update about ghostiness (+ word-wrapping)

* Add ghostify function (#1)

* Add `Location.ghostify`

* Update the parser's `make_ghost` to save an allocation in some cases

* Promote parser.ml

* Mark the inner mutable arrays for iarrays as ghost

* Add comment about ghostification for comprehensions

* Explain that ppxlib is where the ghostiness requirement is enforced

* Use `Ast_helper.default_loc` to default the generated locations

* Restore propagating the location, now via `Ast_helper.default_loc`

* Drop obsolete comment

* Rewrite advisory comment about locations
antalsz added a commit that referenced this pull request Jun 5, 2023
* Parse `#0`, `-#1`, `#2.7`, and `-#3.1`, treating them as boxed

* Fix parsing of unsuffixed unboxed int literals

* Rewrite CR comment

* Update comment

* promote-menhir

* Unboxed literal tests

* Adjust error for unsuffixed unboxed integers
goldfirere referenced this pull request in goldfirere/flambda-backend Jan 1, 2024
goldfirere referenced this pull request in goldfirere/flambda-backend Jan 31, 2024
goldfirere added a commit that referenced this pull request Feb 14, 2024
* new solver

* better printing

* remove solver_mono from mode_intf

* document solver_polarized

* address some comments

* address more comments

* rename "constrain" to "zap"

* rename constrain_legacy

* make depend

* make fmt

* remove _intf.ml

* use comonadic in env

* Add Allow_Disallow, restricting types of Obj.magic

* Fix type errors discovered in previous commit

* Use Allow_disallow in more places

* show soundness of allow_disallow

* Prevent chance of forgetting the "sound" version

* minor changes

* Remove the Solver_polarized.morph type (#1)

* adjust comments

* remove address_of

* more comments

* make [log] non-optional

* better comments

* More fixes

* bind temp results

* add C.eq_morph

* set_append_changes

* compare Value with Alloc

* more comments

* warn about infinite lattices

* Small simplification to set_obj

* example of variable cycle

* say "uniqueness_op" because monotonicity

* rename set to lift

* exhaustive match

* inline unusual helper functions

* fix rebase issues

* Small simplification

* some renaming and comments

* more comment

* remove un-needed assertions.

* fix chamelon

* make fmt

* add file header comments

* exhausive match

* use ref for morph counting

* Reorder in maybe_compose

* switch from lift to map

* avoid caml_curry

* dedup in join and meet

* better error message

* fix tests

* comments

* inlining newvar_above/blow, and more uncurrying

* remove ?logging

* make sure arity is correct and avoid closure allocation

* remove morphism counting

* force inline to avoid caml_applyX

* address comments

* rename and phy eq in eq_morphvar

* Small improvement to [eq_morphvar]

* better comments about lattices

* don't hint to use exclave when useless

* fix type_argument

* comments about inner_alloc_mode

* magic for eq_obj and eq_morph

* allow/disallow for Value.List

* Add comment about actual vs expected

* comment mode_argument

* eq_morph doesn't take dst

* Magic_equal

* better comment about adjunction

* abstraction in ctype

* comment close_over and partial_apply

* fix eta expansion bug

* Alloc.Const.t is record, not tuple

* Simplify interface to [close_over]

* Generalize the type of close_over

* fixed definition of partial adjoint

* better comment about partial adjoint

* even better comments

* make fmt

* bootstrap

---------

Co-authored-by: Richard Eisenberg <[email protected]>
Co-authored-by: Richard Eisenberg <[email protected]>
lukemaurer pushed a commit that referenced this pull request Oct 23, 2024
…sms (#1760)

* new solver

* better printing

* remove solver_mono from mode_intf

* document solver_polarized

* address some comments

* address more comments

* rename "constrain" to "zap"

* rename constrain_legacy

* make depend

* make fmt

* remove _intf.ml

* use comonadic in env

* Add Allow_Disallow, restricting types of Obj.magic

* Fix type errors discovered in previous commit

* Use Allow_disallow in more places

* show soundness of allow_disallow

* Prevent chance of forgetting the "sound" version

* minor changes

* Remove the Solver_polarized.morph type (#1)

* adjust comments

* remove address_of

* more comments

* make [log] non-optional

* better comments

* More fixes

* bind temp results

* add C.eq_morph

* set_append_changes

* compare Value with Alloc

* more comments

* warn about infinite lattices

* Small simplification to set_obj

* example of variable cycle

* say "uniqueness_op" because monotonicity

* rename set to lift

* exhaustive match

* inline unusual helper functions

* fix rebase issues

* Small simplification

* some renaming and comments

* more comment

* remove un-needed assertions.

* fix chamelon

* make fmt

* add file header comments

* exhausive match

* use ref for morph counting

* Reorder in maybe_compose

* switch from lift to map

* avoid caml_curry

* dedup in join and meet

* better error message

* fix tests

* comments

* inlining newvar_above/blow, and more uncurrying

* remove ?logging

* make sure arity is correct and avoid closure allocation

* remove morphism counting

* force inline to avoid caml_applyX

* address comments

* rename and phy eq in eq_morphvar

* Small improvement to [eq_morphvar]

* better comments about lattices

* don't hint to use exclave when useless

* fix type_argument

* comments about inner_alloc_mode

* magic for eq_obj and eq_morph

* allow/disallow for Value.List

* Add comment about actual vs expected

* comment mode_argument

* eq_morph doesn't take dst

* Magic_equal

* better comment about adjunction

* abstraction in ctype

* comment close_over and partial_apply

* fix eta expansion bug

* Alloc.Const.t is record, not tuple

* Simplify interface to [close_over]

* Generalize the type of close_over

* fixed definition of partial adjoint

* better comment about partial adjoint

* even better comments

* make fmt

* bootstrap

---------

Co-authored-by: Richard Eisenberg <[email protected]>
Co-authored-by: Richard Eisenberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants