Skip to content

Remove useless interface #50

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

xclerc
Copy link
Contributor

@xclerc xclerc commented Jun 10, 2021

When ocamlcfg was imported, all files were copied, but
ocamlcfg.ml{,i} is essentially useless: in the "standalone"
ocamlcfg, it acts as the interface exposed to users (because
the other modules are declared private), but it is not the case
here.

I am not entirely sure it is a good idea, as we could also decide
to re-instate a proper interface (that would need to be slightly
extended, though), but I thought it would be useful to discuss it.

@gretay-js
Copy link
Contributor

The purpose of this interface was to limit the ways in which the underlying Cfg can be mutated (to make it easier to reason about correctness of block reordering performed by ocamlfdo). I think this is a valuable property to keep, even if it is not enforced by the build system. The rest of the backend should use the modules in the cfg directory via Ocamlcfg interface only. Maybe we can also have a separate cfg library in compiler-libs.

What interface extensions did you have in mind?

@xclerc
Copy link
Contributor Author

xclerc commented Jun 11, 2021

What interface extensions did you have in mind?

Well, with the current interface, I think the only way to get a
graph is from a Linear.fundecl value. So, we would need
to be able to build/modify a graph.

@gretay-js
Copy link
Contributor

What interface extensions did you have in mind?

Well, with the current interface, I think the only way to get a
graph is from a Linear.fundecl value. So, we would need
to be able to build/modify a graph.

@gretay-js gretay-js closed this Jun 11, 2021
@gretay-js gretay-js reopened this Jun 11, 2021
@gretay-js
Copy link
Contributor

I clicked closed by mistake, sorry.

Yes, it would be fine to add Mach_to_cfg to Ocamlcfg interface.

@xclerc
Copy link
Contributor Author

xclerc commented Jun 11, 2021

Yes, it would be fine to add Mach_to_cfg to Ocamlcfg interface.

I guess this is a matter of taste; I was picturing Ocamlcfg as a
general data structure that could be used for various purposes
rather than a set of translators from/to linear, mach, etc.

@gretay-js
Copy link
Contributor

The interface can have a generic data flow analysis and transformation framework, similarly to what is recently merged upstream.

@mshinwell @lpw25 : do you think we should remove the interface?

@lpw25
Copy link
Collaborator

lpw25 commented Jun 14, 2021

Having an kind of library level interface for the rest of the compiler seems fine. For example, middle_end/flambda/flambda_middle_end.mli provides a similar thing for the flambda phases of the compiler. But I would expect that to be a high-level interface, not suitable to be used by e.g. FDO. I would expect the CFG-based passes themselves to access the CFG with a separate lower-level interface.

It seems like the invariant you are trying to maintain with the current interface is very specific to FDO and would not be suitable for any of the other passes that manipulate the CFG. So I think I would expect that specific interface to be part of FDO itself -- it's own personal wrapper around CFG to ensure that it doesn't make unexpected transformations.

@gretay-js
Copy link
Contributor

So I think I would expect that specific interface to be part of FDO itself -- it's own personal wrapper around CFG to ensure that it doesn't make unexpected transformations.

good point! I'll add Ocamlcfg to ocamlfdo.

@gretay-js gretay-js merged commit 5d56f06 into ocaml-flambda:4.11 Jun 21, 2021
stedolan added a commit to stedolan/flambda-backend that referenced this pull request Jan 18, 2022
1924269795 Several fixes for partial application and currying
4fee6ae2e8 Pprintast support for new local syntax
8df43e93e5 Quieten Makefile when runtime dep files are not present
88ec84e29e Typecheck x |> f y as (f y x), not ((f y) x)
87a10e3348 Remove autogeneration of @ocaml.curry
c656dc9 Merge flambda-backend changes
11b5424 Avoid printing double spaces in function argument lists
7751faa Restore locations to Typedtree.{pat,let}_bound_idents_full
e450b6c add build_ocaml_compiler.sexp
0403bb3 Revert PR 9895 to continue installing VERSION
b3447db Ensure new local attributes are namespaced properly
7f213fc Allow empty functions again
8f22ad8 Bugfix: ensure local domain state is initialised
80f54dd Bugfix for Selectgen with regions
e8133a1 Fix external-external signature inclusion
9840051 Bootstrap
d879f23 Merge remote-tracking branch 'jane/local-reviewed' into local-merge
94454f5 Use Local_store for the local allocations ref
54a164c Create fewer regions, according to typechecking (ocaml-flambda#59)
1c2479b Merge flambda-backend changes
ce34678 Fix printing of modes in return types
91f2281 Hook mode variable solving into Btype.snapshot/backtrack
54e4b09 Move Alloc_mode and Value_mode to Btype
ff4611e Merge flambda-backend changes
ce62e45 Ensure allocations are initialised, even dead ones
6b6ec5a Fix the alloc.ml test on 32-bit builds
81e9879 Merge flambda-backend changes
40a7f89 Update repo URL for ocaml-jst, and rename script.
0454ee7 Add some new locally-allocating primitives (ocaml-flambda#57)
8acdda1 Reset the local stack pointer in exception handlers (ocaml-flambda#56)
8dafa98 Improve typing for (||) and (&&) (ocaml-flambda#55)
8c64754 Fix make_check_all_arches (ocaml-flambda#54)
b50cd45 Allow arguments to primitives to be local even in tail position (ocaml-flambda#53)
cad125d Fix modes from or-patterns (ocaml-flambda#50)
4efdb72 Fix tailcalls tests with inlining (ocaml-flambda#52)
4a795cb Flambda support (ocaml-flambda#49)
74722cb Add [@ocaml.principal] and [@ocaml.noprincipal] attributes, and use in oo.mli
6d7d3b8 Ensure that functions are evaluated after their arguments (flambda-backend ocaml-flambda#353)
89bda6b Keep Sys.opaque_identity in Cmm and Mach (port upstream PR 9412)
a39126a Fix tailcalls within regions (ocaml-flambda#48)
4ac4cfd Fix stdlib manpages build
3a95f5e Merge flambda-backend changes
efe80c9 Add jane/pull-flambda-patches script
fca94c4 Register allocations for Omitted parameter closures (ocaml-flambda#47)
103b139 Remove various FIXMEs (ocaml-flambda#46)
62ba2c1 Bootstrap
a0062ad Allow local allocations for various primitives (ocaml-flambda#43)
7a2165e Allow primitives to be poly-moded (ocaml-flambda#43)
2af3f55 Fix a flaky test by refactoring TypePairs (ocaml/ocaml#10638)
58dd807 Bootstrap
ee3be10 Fix modes in build_apply for partial applications
fe73656 Tweak for evaluation order of labelled partial applications (#10653)
0527570 Fix caml_modify on local allocations (ocaml-flambda#40)
e657e99 Relax modes for `as` patterns (ocaml-flambda#42)
f815bf2 Add special mode handling for tuples in matches and let bindings (ocaml-flambda#38)
39f1211 Only take the upper bounds of modes associated with allocations (ocaml-flambda#37)
aec6fde Interpret arrow types in "local positions" differently
c4f3319 Bootstrap
ff6fdad Add some missing regions
40d586d Bootstrap
66d8110 Switch to a system with 3 modes for values
f2c5a85 Bugfix for Comballoc with local allocations. (ocaml-flambda#41)
83bcd09 Fix bug with root scanning during compaction (ocaml-flambda#39)
1b5ec83 Track modes in Lambda.lfunction and onwards (ocaml-flambda#33)
f1e2e97 Port ocaml/ocaml#10728
56703cd Port ocaml/ocaml#10081
eb66785 Support local allocations in i386 and fix amd64 bug (ocaml-flambda#31)
c936b19 Disallow local recursive non-functions (ocaml-flambda#30)
c7a193a GC support for local allocations (ocaml-flambda#29)
8dd7270 Nonlocal fields (ocaml-flambda#28)
e19a2f0 Bootstrap
694b9ac Add syntax to the parser for local allocations (ocaml-flambda#26)
f183008 Lower initial stack size
918226f Allow local closure allocations (ocaml-flambda#27)
2552e7d Introduce mode variables (ocaml-flambda#25)
bc41c99 Minor fixes for local allocations (ocaml-flambda#24)
a2a4e60 Runtime and compiler support for more local allocations (ocaml-flambda#23)
d030554 Typechecking for local allocations (ocaml-flambda#21)
9ee2332 Bugfix missing from ocaml-flambda#20
02c4cef Retain block-structured local regions until Mach.
86dbe1c amd64: Move stack realloc calls out-of-line
324d218 More typing modes and locking of environments
a4080b8 Initial version of local allocation (unsafe)

git-subtree-dir: ocaml
git-subtree-split: 1924269795db2450be5c084f7799340e0e003e19
stedolan added a commit that referenced this pull request Feb 1, 2022
173842c Merge flambda-backend changes
ed7eba2 Remove leading space from LINE. (#484)
bd61170 Bump magic numbers (#5)
c50c47d Add CI builds with local allocations enabled
1412792 Move local allocations support behind '-extension local'
6d8e42a Better tail call behaviour in caml_applyN
c7dac3d Typemod: toplevel bindings escape even if no variables are bound
82d6c3e Several fixes for partial application and currying
d05c70c Pprintast support for new local syntax
e0e62fc Typecheck x |> f y as (f y x), not ((f y) x)
d7e34ce Remove autogeneration of @ocaml.curry
b9a0593 Port #493
0a872d9 Code review fixes from #491
6c168bb Remove local allocation counting
3c6e7f0 Code review fixes from #478
bb97207 Rename Lambda.apply_position
a7cb650 Quieten Makefile when runtime dep files are not present
c656dc9 Merge flambda-backend changes
11b5424 Avoid printing double spaces in function argument lists
7751faa Restore locations to Typedtree.{pat,let}_bound_idents_full
e450b6c add build_ocaml_compiler.sexp
0403bb3 Revert PR 9895 to continue installing VERSION
b3447db Ensure new local attributes are namespaced properly
7f213fc Allow empty functions again
8f22ad8 Bugfix: ensure local domain state is initialised
80f54dd Bugfix for Selectgen with regions
e8133a1 Fix external-external signature inclusion
9840051 Bootstrap
d879f23 Merge remote-tracking branch 'jane/local-reviewed' into local-merge
94454f5 Use Local_store for the local allocations ref
54a164c Create fewer regions, according to typechecking (#59)
1c2479b Merge flambda-backend changes
ce34678 Fix printing of modes in return types
91f2281 Hook mode variable solving into Btype.snapshot/backtrack
54e4b09 Move Alloc_mode and Value_mode to Btype
ff4611e Merge flambda-backend changes
ce62e45 Ensure allocations are initialised, even dead ones
6b6ec5a Fix the alloc.ml test on 32-bit builds
81e9879 Merge flambda-backend changes
40a7f89 Update repo URL for ocaml-jst, and rename script.
0454ee7 Add some new locally-allocating primitives (#57)
8acdda1 Reset the local stack pointer in exception handlers (#56)
8dafa98 Improve typing for (||) and (&&) (#55)
8c64754 Fix make_check_all_arches (#54)
b50cd45 Allow arguments to primitives to be local even in tail position (#53)
cad125d Fix modes from or-patterns (#50)
4efdb72 Fix tailcalls tests with inlining (#52)
4a795cb Flambda support (#49)
74722cb Add [@ocaml.principal] and [@ocaml.noprincipal] attributes, and use in oo.mli
6d7d3b8 Ensure that functions are evaluated after their arguments (flambda-backend #353)
89bda6b Keep Sys.opaque_identity in Cmm and Mach (port upstream PR 9412)
a39126a Fix tailcalls within regions (#48)
4ac4cfd Fix stdlib manpages build
3a95f5e Merge flambda-backend changes
efe80c9 Add jane/pull-flambda-patches script
fca94c4 Register allocations for Omitted parameter closures (#47)
103b139 Remove various FIXMEs (#46)
62ba2c1 Bootstrap
a0062ad Allow local allocations for various primitives (#43)
7a2165e Allow primitives to be poly-moded (#43)
2af3f55 Fix a flaky test by refactoring TypePairs (ocaml/ocaml#10638)
58dd807 Bootstrap
ee3be10 Fix modes in build_apply for partial applications
fe73656 Tweak for evaluation order of labelled partial applications (#10653)
0527570 Fix caml_modify on local allocations (#40)
e657e99 Relax modes for `as` patterns (#42)
f815bf2 Add special mode handling for tuples in matches and let bindings (#38)
39f1211 Only take the upper bounds of modes associated with allocations (#37)
aec6fde Interpret arrow types in "local positions" differently
c4f3319 Bootstrap
ff6fdad Add some missing regions
40d586d Bootstrap
66d8110 Switch to a system with 3 modes for values
f2c5a85 Bugfix for Comballoc with local allocations. (#41)
83bcd09 Fix bug with root scanning during compaction (#39)
1b5ec83 Track modes in Lambda.lfunction and onwards (#33)
f1e2e97 Port ocaml/ocaml#10728
56703cd Port ocaml/ocaml#10081
eb66785 Support local allocations in i386 and fix amd64 bug (#31)
c936b19 Disallow local recursive non-functions (#30)
c7a193a GC support for local allocations (#29)
8dd7270 Nonlocal fields (#28)
e19a2f0 Bootstrap
694b9ac Add syntax to the parser for local allocations (#26)
f183008 Lower initial stack size
918226f Allow local closure allocations (#27)
2552e7d Introduce mode variables (#25)
bc41c99 Minor fixes for local allocations (#24)
a2a4e60 Runtime and compiler support for more local allocations (#23)
d030554 Typechecking for local allocations (#21)
9ee2332 Bugfix missing from #20
02c4cef Retain block-structured local regions until Mach.
86dbe1c amd64: Move stack realloc calls out-of-line
324d218 More typing modes and locking of environments
a4080b8 Initial version of local allocation (unsafe)

git-subtree-dir: ocaml
git-subtree-split: 173842c
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull request Dec 13, 2022
1bb6c79 Merge pull request ocaml-flambda#78 from mshinwell/flambda-backend-patches-2022-12-13
9029581 Update otherlibs/dynlink/Makefile
3e4f1b9 Revert toplevel/native/dune to ocaml-jst version
6061e4c Regenerate configure using autoconf 2.71
888d4b1 Back out patch which disables alloc-check in ocaml-jst
a6d5796 Fix dynlink build
3e46daf Update .depend files
a5c547e Bootstrap
a6a9031 Merge flambda-backend changes
0ac7fdd temp fix for linker error (ocaml-flambda#77)
e2d0d9e Enable individual testing with Makefile.jst (ocaml-flambda#76)
2a7e501 Use a more relaxed mode for unification in Ctype.subst (#11771) (ocaml-flambda#73)
cbd791a Allow immediates to cross modes (ocaml-flambda#58)
549d757 Run "misplaced attributes" check when compiling mlis (ocaml-flambda#72)
a6c0e75 Ensure that Ctype.nongen always calls remove_mode_variables (ocaml-flambda#70)
6c50831 array elements are global (ocaml-flambda#67)
8788ff6 Add/move some documentation
9891a36 Propagate location information to `local_` in expressions
988306d Add support for `global_` and `nonlocal_` constructor arguments (ocaml-flambda#50)
e7dd740 Add debug_printers.ml (ocaml-flambda#63)
65f2896 more entries in gitignore (ocaml-flambda#62)
a9a84d0 Move `global_flag` to `Asttypes` (ocaml-flambda#60)
fac5896 Minor attribute fixes from flambda-backend
75f402e Note about make install and Makefile.jst (ocaml-flambda#56)

git-subtree-dir: ocaml
git-subtree-split: 1bb6c79
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull request Dec 13, 2022
985725b Add dynlink_compilerlibs.mli to .gitignore (ocaml-flambda#79)
2b1fa24 Regenerate parser (ocaml-flambda#80)
1bb6c79 Merge pull request ocaml-flambda#78 from mshinwell/flambda-backend-patches-2022-12-13
9029581 Update otherlibs/dynlink/Makefile
3e4f1b9 Revert toplevel/native/dune to ocaml-jst version
6061e4c Regenerate configure using autoconf 2.71
888d4b1 Back out patch which disables alloc-check in ocaml-jst
a6d5796 Fix dynlink build
3e46daf Update .depend files
a5c547e Bootstrap
a6a9031 Merge flambda-backend changes
0ac7fdd temp fix for linker error (ocaml-flambda#77)
e2d0d9e Enable individual testing with Makefile.jst (ocaml-flambda#76)
2a7e501 Use a more relaxed mode for unification in Ctype.subst (#11771) (ocaml-flambda#73)
cbd791a Allow immediates to cross modes (ocaml-flambda#58)
549d757 Run "misplaced attributes" check when compiling mlis (ocaml-flambda#72)
a6c0e75 Ensure that Ctype.nongen always calls remove_mode_variables (ocaml-flambda#70)
6c50831 array elements are global (ocaml-flambda#67)
8788ff6 Add/move some documentation
9891a36 Propagate location information to `local_` in expressions
988306d Add support for `global_` and `nonlocal_` constructor arguments (ocaml-flambda#50)
e7dd740 Add debug_printers.ml (ocaml-flambda#63)
65f2896 more entries in gitignore (ocaml-flambda#62)
a9a84d0 Move `global_flag` to `Asttypes` (ocaml-flambda#60)
fac5896 Minor attribute fixes from flambda-backend
75f402e Note about make install and Makefile.jst (ocaml-flambda#56)

git-subtree-dir: ocaml
git-subtree-split: 985725b
mshinwell added a commit to mshinwell/flambda-backend that referenced this pull request Dec 28, 2022
a09392d Set Menhir version back to 20210419 again (ocaml-flambda#89)
cc63992 Merge pull request ocaml-flambda#88 from mshinwell/flambda-backend-changes-2022-12-27
3e49df3 HACKING.jst.adoc
1866676 Merge flambda-backend changes
e012992 Merge pull request ocaml-flambda#87 from mshinwell/merge-4.14.1
ac5c7c8 Merge tag '4.14.1' into main
3da21bc add a useful debug printer
83b7c72 Document the debug_printers script
98896e0 Remove a tiny code stutter I came across
99cb5d9 release 4.14.1
b49060f last commit before tagging 4.14.1
fae9aef Add documentation
708e5a9 Add tests
c609eee Bootstrap
7f922d0 Polymorphic parameters
51aeb04 Keep generalized structure from patterns when typing let
4b68bb3 Add test of princiaplity from polymorphic type constraints
82c7afe fix wong raise
aca252f x86: Force result of Icomp to be in a register (#11808)
985725b Add dynlink_compilerlibs.mli to .gitignore (ocaml-flambda#79)
2b1fa24 Regenerate parser (ocaml-flambda#80)
1bb6c79 Merge pull request ocaml-flambda#78 from mshinwell/flambda-backend-patches-2022-12-13
9029581 Update otherlibs/dynlink/Makefile
3e4f1b9 Revert toplevel/native/dune to ocaml-jst version
6061e4c Regenerate configure using autoconf 2.71
888d4b1 Back out patch which disables alloc-check in ocaml-jst
a6d5796 Fix dynlink build
3e46daf Update .depend files
a5c547e Bootstrap
a6a9031 Merge flambda-backend changes
0ac7fdd temp fix for linker error (ocaml-flambda#77)
1018602 Remove references to 32-bit Cygwin (#11797)
e2d0d9e Enable individual testing with Makefile.jst (ocaml-flambda#76)
f10cbf6 increment version number after tagging 4.14.1~rc1
11c5ab7 release 4.14.1~rc1
e4c3920 last commit before tagging 4.14.1~rc1
9e598ca Merge pull request #11793 from dra27/then-than
2a7e501 Use a more relaxed mode for unification in Ctype.subst (#11771) (ocaml-flambda#73)
7b35ef7 Statically initialize `caml_global_data` with a valid value (#11788)
cbd791a Allow immediates to cross modes (ocaml-flambda#58)
85a0817 Merge pull request #11534 from gasche/follow-synonyms-in-show-module-type
699f43c Changes
e54e9bc fix the 'stuttering' issue in #show
d9799d3 test comments
fec3b23 follow synonyms when #show-ing module types
06a1ad7 regression tests for #11533 (still failing)
549d757 Run "misplaced attributes" check when compiling mlis (ocaml-flambda#72)
b2b74bf Fix bug in `Mtype.strengthen_lazy` causing spurious typing errors (#11776)
a6c0e75 Ensure that Ctype.nongen always calls remove_mode_variables (ocaml-flambda#70)
6c50831 array elements are global (ocaml-flambda#67)
bc510ed Ensure that types from packed modules are always generalised (#11732)
4d47036 Fix #10768
8788ff6 Add/move some documentation
9891a36 Propagate location information to `local_` in expressions
988306d Add support for `global_` and `nonlocal_` constructor arguments (ocaml-flambda#50)
6729eb8 Missing CAMLparam in win32's Unix.stat (#11737)
e7dd740 Add debug_printers.ml (ocaml-flambda#63)
65f2896 more entries in gitignore (ocaml-flambda#62)
a9a84d0 Move `global_flag` to `Asttypes` (ocaml-flambda#60)
fac5896 Minor attribute fixes from flambda-backend
75f402e Note about make install and Makefile.jst (ocaml-flambda#56)
fb5b1e4 Remove the -force-tmc flag (#11661)
bd87a61 ocamlmklib: use `ar rcs` instead of `ar rc` (#11670)
83762af Merge pull request #11622 from Octachron/fix_recursive_types_in_constructor_mismatch
ca48730 Merge pull request #11609 from Octachron/pr11194_unbound_and_printing_context

git-subtree-dir: ocaml
git-subtree-split: a09392d
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants