Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Ensure push_defaults can push past module patterns#11727

Merged
gasche merged 2 commits intoocaml:trunkfromstedolan:push-defaults-module-pat-fix
Nov 16, 2022

Conversation

stedolan
Copy link
Contributor

This patch fixes a small bug introduced in#10340 in the handling of first class module parameters. This is a performance issue rather than a correctness one: in the current code, module parameters defeat currying optimisations, so a function like the following will process arguments and allocate closures one at a time:

let f (module M : A) () = 1

The issue is that, whileTranslcore.push_defaults does contain code to specifically handle this case, it cannot be reached because the module binding expands to a pattern involvingTpat_alias, which fails the newis_trivial check. The fix is to extendis_trivial to coverTpat_alias as well.

Copy link
Member

@gaschegasche left a comment

Choose a reason for hiding this comment

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

Clearly correct.

Would you maybe consider making the catch-all case intrivial_pattern list the ignored constructors? It could have been a way to avoid this issue in the first place.

This may deserve a Changes entry (it fixes a performance bug that users may care about).

@stedolan
Copy link
ContributorAuthor

Thanks for the review.Changes changed.

Would you maybe consider making the catch-all case in trivial_pattern list the ignored constructors? It could have been a way to avoid this issue in the first place.

I don't actually think that would help here. We did think of and discuss handling other cases inis_trivial at the time, but this issue never came up. The problem is thatis_trivial must not only handle code that the user writes, but also the fake parsetree nodes generated by expansion of module patterns. I think the ways to avoid this issue are (a) a test (which this patch adds), and (b) a less implicit encoding of module patterns (which I'd like to do someday, but not today)

@gaschegasche merged commit6d68843 intoocaml:trunkNov 16, 2022
stedolan added a commit to stedolan/flambda-backend that referenced this pull requestNov 17, 2022
stedolan added a commit to stedolan/flambda-backend that referenced this pull requestNov 17, 2022
lpw25 pushed a commit to ocaml-flambda/flambda-backend that referenced this pull requestNov 18, 2022
mshinwell pushed a commit to ocaml-flambda/ocaml-jst that referenced this pull requestDec 13, 2022
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull requestDec 13, 2022
06c189a flambda-backend: Make stack allocation the default (ocaml-flambda#1013)98debd5 flambda-backend: Initial support for value slots not of value kind (ocaml-flambda#946)deb1714 flambda-backend: Add is_last flag to closinfo words (ocaml-flambda#938)d07fce1 flambda-backend: Disable poll insertion in Configure (ocaml-flambda#967)0f1ce0e flambda-backend: Regenerate ocaml/configure autoconf 2.69 (instead of 2.71) (ocaml-flambda#1012)27132d8 flambda-backend: Fix for spurious typing error related to expanding through functor arguments (ocaml-flambda#997)724fb68 flambda-backend: Use `Compilation_unit.t` instead of `Ident.t` for globals (ocaml-flambda#871)396d5b8 flambda-backend: Add a test for frametable setup in natdynlinked libraries (ocaml-flambda#983)b73ab12 flambda-backend: Fix invocation of `caml_shared_startup` in native dynlink (ocaml-flambda#980)7c7d75a flambda-backend: Fix split_default_wrapper which did not trigger anymore with flambda2 (ocaml-flambda#970)8fb75bd flambda-backend: Portocaml/ocaml#11727 andocaml/ocaml#11732 (ocaml-flambda#965)fdb7987 flambda-backend: Fix include functor issue after 4.14 merge. (ocaml-flambda#948)9745cdb flambda-backend: Print -dprofile/-dtimings output to stdout like 4.12 (ocaml-flambda#943)5f51f21 flambda-backend: Merge pull requestocaml-flambda#932 from mshinwell/4.14-upgrade841687d flambda-backend: Run make alldepend in ocaml/ (ocaml-flambda#936)72a7658 flambda-backend: Remove reformatting changes only in dynlink/dune (preserving PR889 and adjusting to minimise diff)6d758cd flambda-backend: Revert whitespace changes in dune files, to match upstreamc86bf6e flambda-backend: Remove duplicate tests for polling971dbeb flambda-backend: Testsuite fixes32f8356 flambda-backend: Topeval fix for symbols patchbefea01 flambda-backend: Compilation fixes / rectify merge faultsa84543f flambda-backend: Merge ocaml-jst8e65056 flambda-backend: Merge ocaml-jst4d70045 flambda-backend: Remove filename from system frametable (amd64) (ocaml-flambda#920)5e57b7d flambda-backend: Bugfix for runtime frame_descr logic for C frames (ocaml-flambda#918)6423d5e flambda-backend: Merge pull requestocaml-flambda#914 from mshinwell/merge-ocaml-jst-2022-10-24ead605c flambda-backend: Add a missing Extract_exception (ocaml-flambda#916)c8f1481 flambda-backend: Resolve conflicts and add specialise/specialised attributes to Builtin_attributescf4d0d3 flambda-backend: Merge fixes (#21)c2f742f flambda-backend: Re-enable some tests for Flambda2 (ocaml-flambda#881)3d38d13 flambda-backend: Long frames in frametable (ocaml-flambda#797)85aec7b flambda-backend: Add loop attribute to Builtin_attributesc0f16e3 flambda-backend: Compilation fixes90dea23 flambda-backend: Merge flambda-backend/main5acc6ea flambda-backend: Fixes after mergee501946 flambda-backend: Merge ocaml-jst115083b flambda-backend: Merge ocaml-jst9943b2e flambda-backend: Revert "Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"" (ocaml-flambda#909)ce339f1 flambda-backend: Fix alloc modes and call kinds for overapplications (ocaml-flambda#902)e6a317c flambda-backend: Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"853c488 flambda-backend: Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)5a977e4 flambda-backend: Fix missing End_region primitives on switch arms (ocaml-flambda#898)7fa7f9d flambda-backend: Add missing dependencies to Dune files (ocaml-flambda#889)3cd36f0 flambda-backend: Have Lambda `Pgetglobal` and `Psetglobal` take `Compilation_unit.t` (ocaml-flambda#896)7565915 flambda-backend: [@poll error] attribute (ocaml-flambda#745)9eb9448 flambda-backend: Backport the main safepoints PRs (ocaml-flambda#740)689bdda flambda-backend: Add strict mode for ocamldep (ocaml-flambda#892)git-subtree-dir: ocamlgit-subtree-split:06c189a
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull requestDec 13, 2022
06c189a flambda-backend: Make stack allocation the default (ocaml-flambda#1013)98debd5 flambda-backend: Initial support for value slots not of value kind (ocaml-flambda#946)deb1714 flambda-backend: Add is_last flag to closinfo words (ocaml-flambda#938)d07fce1 flambda-backend: Disable poll insertion in Configure (ocaml-flambda#967)0f1ce0e flambda-backend: Regenerate ocaml/configure autoconf 2.69 (instead of 2.71) (ocaml-flambda#1012)27132d8 flambda-backend: Fix for spurious typing error related to expanding through functor arguments (ocaml-flambda#997)724fb68 flambda-backend: Use `Compilation_unit.t` instead of `Ident.t` for globals (ocaml-flambda#871)396d5b8 flambda-backend: Add a test for frametable setup in natdynlinked libraries (ocaml-flambda#983)b73ab12 flambda-backend: Fix invocation of `caml_shared_startup` in native dynlink (ocaml-flambda#980)7c7d75a flambda-backend: Fix split_default_wrapper which did not trigger anymore with flambda2 (ocaml-flambda#970)8fb75bd flambda-backend: Portocaml/ocaml#11727 andocaml/ocaml#11732 (ocaml-flambda#965)fdb7987 flambda-backend: Fix include functor issue after 4.14 merge. (ocaml-flambda#948)9745cdb flambda-backend: Print -dprofile/-dtimings output to stdout like 4.12 (ocaml-flambda#943)5f51f21 flambda-backend: Merge pull requestocaml-flambda#932 from mshinwell/4.14-upgrade841687d flambda-backend: Run make alldepend in ocaml/ (ocaml-flambda#936)72a7658 flambda-backend: Remove reformatting changes only in dynlink/dune (preserving PR889 and adjusting to minimise diff)6d758cd flambda-backend: Revert whitespace changes in dune files, to match upstreamc86bf6e flambda-backend: Remove duplicate tests for polling971dbeb flambda-backend: Testsuite fixes32f8356 flambda-backend: Topeval fix for symbols patchbefea01 flambda-backend: Compilation fixes / rectify merge faultsa84543f flambda-backend: Merge ocaml-jst8e65056 flambda-backend: Merge ocaml-jst4d70045 flambda-backend: Remove filename from system frametable (amd64) (ocaml-flambda#920)5e57b7d flambda-backend: Bugfix for runtime frame_descr logic for C frames (ocaml-flambda#918)6423d5e flambda-backend: Merge pull requestocaml-flambda#914 from mshinwell/merge-ocaml-jst-2022-10-24ead605c flambda-backend: Add a missing Extract_exception (ocaml-flambda#916)c8f1481 flambda-backend: Resolve conflicts and add specialise/specialised attributes to Builtin_attributescf4d0d3 flambda-backend: Merge fixes (#21)c2f742f flambda-backend: Re-enable some tests for Flambda2 (ocaml-flambda#881)3d38d13 flambda-backend: Long frames in frametable (ocaml-flambda#797)85aec7b flambda-backend: Add loop attribute to Builtin_attributesc0f16e3 flambda-backend: Compilation fixes90dea23 flambda-backend: Merge flambda-backend/main5acc6ea flambda-backend: Fixes after mergee501946 flambda-backend: Merge ocaml-jst115083b flambda-backend: Merge ocaml-jst9943b2e flambda-backend: Revert "Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"" (ocaml-flambda#909)ce339f1 flambda-backend: Fix alloc modes and call kinds for overapplications (ocaml-flambda#902)e6a317c flambda-backend: Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"853c488 flambda-backend: Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)5a977e4 flambda-backend: Fix missing End_region primitives on switch arms (ocaml-flambda#898)7fa7f9d flambda-backend: Add missing dependencies to Dune files (ocaml-flambda#889)3cd36f0 flambda-backend: Have Lambda `Pgetglobal` and `Psetglobal` take `Compilation_unit.t` (ocaml-flambda#896)7565915 flambda-backend: [@poll error] attribute (ocaml-flambda#745)9eb9448 flambda-backend: Backport the main safepoints PRs (ocaml-flambda#740)689bdda flambda-backend: Add strict mode for ocamldep (ocaml-flambda#892)git-subtree-dir: ocamlgit-subtree-split:06c189a
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull requestDec 28, 2022
b11eea1 flambda-backend: Introduce Import_info (ocaml-flambda#1036)bc5b135 flambda-backend: Fix `ocamlobjinfo` on flambda2 .cmx files (ocaml-flambda#1029)c8babbd flambda-backend: Compilation_unit optimisations (ocaml-flambda#1035)e8d3e22 flambda-backend: Use 4.14.0 opam switch for building (includes upgrading ocamlformat to 0.24.1) (ocaml-flambda#1030)eb14a86 flambda-backend: Port PR81 from ocaml-jst (ocaml-flambda#1024)131bc12 flambda-backend: Merge ocaml-jst 2022-12-13 (ocaml-flambda#1022)06c189a flambda-backend: Make stack allocation the default (ocaml-flambda#1013)98debd5 flambda-backend: Initial support for value slots not of value kind (ocaml-flambda#946)deb1714 flambda-backend: Add is_last flag to closinfo words (ocaml-flambda#938)d07fce1 flambda-backend: Disable poll insertion in Configure (ocaml-flambda#967)0f1ce0e flambda-backend: Regenerate ocaml/configure autoconf 2.69 (instead of 2.71) (ocaml-flambda#1012)27132d8 flambda-backend: Fix for spurious typing error related to expanding through functor arguments (ocaml-flambda#997)724fb68 flambda-backend: Use `Compilation_unit.t` instead of `Ident.t` for globals (ocaml-flambda#871)396d5b8 flambda-backend: Add a test for frametable setup in natdynlinked libraries (ocaml-flambda#983)b73ab12 flambda-backend: Fix invocation of `caml_shared_startup` in native dynlink (ocaml-flambda#980)7c7d75a flambda-backend: Fix split_default_wrapper which did not trigger anymore with flambda2 (ocaml-flambda#970)8fb75bd flambda-backend: Portocaml/ocaml#11727 andocaml/ocaml#11732 (ocaml-flambda#965)fdb7987 flambda-backend: Fix include functor issue after 4.14 merge. (ocaml-flambda#948)9745cdb flambda-backend: Print -dprofile/-dtimings output to stdout like 4.12 (ocaml-flambda#943)5f51f21 flambda-backend: Merge pull requestocaml-flambda#932 from mshinwell/4.14-upgrade841687d flambda-backend: Run make alldepend in ocaml/ (ocaml-flambda#936)72a7658 flambda-backend: Remove reformatting changes only in dynlink/dune (preserving PR889 and adjusting to minimise diff)6d758cd flambda-backend: Revert whitespace changes in dune files, to match upstreamc86bf6e flambda-backend: Remove duplicate tests for polling971dbeb flambda-backend: Testsuite fixes32f8356 flambda-backend: Topeval fix for symbols patchbefea01 flambda-backend: Compilation fixes / rectify merge faultsa84543f flambda-backend: Merge ocaml-jst8e65056 flambda-backend: Merge ocaml-jst4d70045 flambda-backend: Remove filename from system frametable (amd64) (ocaml-flambda#920)5e57b7d flambda-backend: Bugfix for runtime frame_descr logic for C frames (ocaml-flambda#918)6423d5e flambda-backend: Merge pull requestocaml-flambda#914 from mshinwell/merge-ocaml-jst-2022-10-24ead605c flambda-backend: Add a missing Extract_exception (ocaml-flambda#916)c8f1481 flambda-backend: Resolve conflicts and add specialise/specialised attributes to Builtin_attributescf4d0d3 flambda-backend: Merge fixes (#21)c2f742f flambda-backend: Re-enable some tests for Flambda2 (ocaml-flambda#881)3d38d13 flambda-backend: Long frames in frametable (ocaml-flambda#797)85aec7b flambda-backend: Add loop attribute to Builtin_attributesc0f16e3 flambda-backend: Compilation fixes90dea23 flambda-backend: Merge flambda-backend/main5acc6ea flambda-backend: Fixes after mergee501946 flambda-backend: Merge ocaml-jst115083b flambda-backend: Merge ocaml-jst9943b2e flambda-backend: Revert "Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"" (ocaml-flambda#909)ce339f1 flambda-backend: Fix alloc modes and call kinds for overapplications (ocaml-flambda#902)e6a317c flambda-backend: Revert "Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)"853c488 flambda-backend: Transform tail-recursive functions into recursive continuations (ocaml-flambda#893)5a977e4 flambda-backend: Fix missing End_region primitives on switch arms (ocaml-flambda#898)7fa7f9d flambda-backend: Add missing dependencies to Dune files (ocaml-flambda#889)3cd36f0 flambda-backend: Have Lambda `Pgetglobal` and `Psetglobal` take `Compilation_unit.t` (ocaml-flambda#896)7565915 flambda-backend: [@poll error] attribute (ocaml-flambda#745)9eb9448 flambda-backend: Backport the main safepoints PRs (ocaml-flambda#740)689bdda flambda-backend: Add strict mode for ocamldep (ocaml-flambda#892)git-subtree-dir: ocamlgit-subtree-split:b11eea1
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gaschegaschegasche approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@stedolan@gasche

[8]ページ先頭

©2009-2025 Movatter.jp