Skip to content

For testing #3833

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

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

For testing #3833

wants to merge 56 commits into from

Conversation

gretay-js
Copy link
Contributor

Test PR #3768 : enable elimination of dead trap handlers by default and fail if there are any.

@gretay-js gretay-js added the testing Ignore these PRs. They're just for testing. label Apr 9, 2025
@gretay-js gretay-js force-pushed the refactor_cfg_dead_code_v2_for_test branch from 31e5014 to 5b4a146 Compare April 11, 2025 07:17
mshinwell and others added 28 commits April 21, 2025 12:54
* Add ubuntu on arm64 github ci actions with an without debug runtime

* Disable test that fails on arm64 / linux
* Merge `_utils` module (backend).

* Simplify `Cfg_cse` interface.
We have a check that the free variables in a probe are all values.
Unfortunately, this check runs _after_ translation to lambda, which means it
considers the free variables of the lambda code. This is bad if the probe has a
reference to a compilation unit that takes a parameter, since that will get
translated to a local variable that doesn't appear in the environment and
therefore we can't check its jkind.

Also, the error one gets in this situation is an uncaught `Not_found` with a
backtrace, which is unpleasant and hard to debug.

Other improvements are possible, but for the moment we can just remember which
lambda-level locals refer to runtime parameters, since those will always have
value jkinds. Additionally, I've added a nicer error message for any other
`Not_found`s that might arise from this check.
* replace groups via regex substitution

* .mlp -> .ml

* escape special characters

* add output channel parametric versions of some helper functions in emitaux

* parameterized emitters in emit.ml

* remove regex note again

* formatting

* remove old emit functions that were commented out

* change format string

* mark load instruction for debugging difference

* mark all load instructions

* Revert "mark all load instructions"

This reverts commit f639636.

* Revert "change format string"

This reverts commit e7c38a2.

* change format string

* Revert "mark load instruction for debugging difference"

This reverts commit 43f8ed3.

---------

Co-authored-by: Simon Spies <simonspies@icloud.com>
…tly" (#3781)

Revert "Merge atomic counter inc/dec functions and use them consistently (#3644)"

This reverts commit f7e9aca.
Copy target specific files in root dune
* Remove type parameter from Select_utils.environment

* Remove tailrec_label instance var

* Make entry and exit fields mutable in Sub_cfg

* Remove the current_sub_cfg instance variable
Clean up regalloc jobs (CI).
* add many nops

* diffing script

* remove hacking-no-watch target and use boot-install instead

* avoid jumping around in commits

* extract also the build directory and add -S flag

* copy bootcompiler instead of final compiler

* fix path

* cleanup

* allow the script to take arguments

* revert changes again to non-script files

* avoid rebuilding the boot compiler to avoid dune rebuilds

* add suggestions for how to diff the result
* Remove _aux suffixes, remove ret, update comment

* Rename emit_sequence etc

* Another removal of ret
New implementation of emit_stores
spiessimon and others added 28 commits April 21, 2025 12:54
… 1) (#3794)

* script to build a mutant compiler for comparison

* start with emitting address; test by duplicating store instructions

* avoid rebuilding the boot compiler accidentally

* remove duplicate stores and replace more instructions

* remove duplicate load instruction

* different load alternatives

* fix typos

* fix printing to match the original

* more loads

* stack pointer

* support for fixed register

* move DSL

* moves

* ocamlformat

* support for unconditional branches

* more branching

* move symbol emit into DSL

* support for labels

* add support for symbols besides labels to ARM Ast

* symbol operands

* support branch lo

* replace several branch instructions with DSL

* memory barriers

* replace lots of standard instructions

* move up DSL further

* do not print tab for empty arguments

* ocamlformat

* remove mutant compiler script from this PR

* mark changes for future PRs

* note that record label should return to its original form
* Remove terminator Specific_can_raise and Arch.can_raise_operation: current target backends don't have specific instructions that can raise.
A simple refactor. Replaces all objects with first-class modules. Inheritance is
mimicked using `include`. There is exactly once instance where that doesn't
work, since a method gets overridden and one one of the remaining methods calls
it, but all that's necessary is to “override” both “methods” (and they're not
even in different files so it's easy).

The formatting is pretty wonky as I was hoping to keep a small diff in case
changes are made upstream. (Obviously this can only help so much, especially
given the repeated uses of `method`.)
Co-authored-by: Simon Spies <sspies@janestreet.com>
* remove cvt_emit

* remove various .mlp references and settings for .mlp files

* catch another emit.mlp reference
…3825)

Remove reference to `simple_operation.ml*` in `.ocamlformat-enable`.
* Make weak_array_par more likely to fail on arm64

* Add appropriate memory fences on ephemeron updates
* add hashes for immediates
* remove aliases and add missing comparison
* remove always and never
… 2) (#3813)

* Extend ARM DSL and use it for the emission of more instructions (Part 2)

* ocamlformat

* naming

* Small code cleanup changes

* preallocate registers and operands

* review

* cleanup

* fix stack realloc instruction

* Handle remaining instruction + refactoring of the memory addressing

Co-authored-by: Greta Yorsh <45005955+gretay-js@users.noreply.github.com>

* replace remaining load and store instructions

* cleanup

---------

Co-authored-by: Greta Yorsh <45005955+gretay-js@users.noreply.github.com>
Ensure that Alias bindings are not substituted under lambda

This used to be the case, but the recent refactoring of Lletrec introduced a bug.
(Due to locals, this is a soundness issue rather than just poor optimisation)
The test has been observed to fail on bytecode too, disable it.
* Move all dead code passes into Cfg_simplify and delete trap handlers
* Fix catch-try*.cmm tests
* Add compilation flag -cfg-eliminate-dead-trap-handlers
* Add flag cfg-eliminate-dead-trap-handlers to some github ci jobs
@gretay-js gretay-js force-pushed the refactor_cfg_dead_code_v2_for_test branch from 5b4a146 to d756cef Compare April 21, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Ignore these PRs. They're just for testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants