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

wasm-mutate: Clean up egg rule definitions and extract smallest AST size expression when reducing #413

Merged
merged 4 commits into from
Dec 6, 2021

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Dec 3, 2021

No description provided.

@fitzgen fitzgen requested a review from cfallin December 3, 2021 23:17
@fitzgen
Copy link
Member Author

fitzgen commented Dec 3, 2021

cc @Jacarte

@fitzgen
Copy link
Member Author

fitzgen commented Dec 3, 2021

Oh, the other thing that this does is make the rules unidirectional (most are bidirectional by default) when we are reducing, so that we only make the expression smaller. This could, in theory, miss out on some size-reducing optimizations that take a long, circuitous route to get to their final form, but I think that will be pretty rare in practice and we should get a nice speed up this way since we are dealing with fewer rewrite rules.

Reorganizes and reformats our `egg` rules.

Also adds a few missing rules, such as some commutativity and associativity
rules and some non-semantics-preserving rules.
… peephole mutator

This ensures that we are actually reducing the expression (or at least not
making it larger).
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

LGTM!

crates/wasm-mutate/src/mutators/peephole/eggsy/lang.rs Outdated Show resolved Hide resolved
@fitzgen fitzgen merged commit e9ac092 into bytecodealliance:main Dec 6, 2021
@fitzgen fitzgen deleted the clean-up-wasm-mutate-rules branch December 6, 2021 18:36
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this pull request Nov 16, 2022
* syntax: world + interface

Signed-off-by: Brian H <brian.hardock@fermyon.com>

* Get tests passing

Remove all parsing tests related to `use` along the way to get re-added
once `use` is re-implemented for top-level worlds.

* Update wit-parser tests to worlds

Drop usage of the old `Interface::parse_file` function.

* Add some basic tests for world

Assert some assorted failures as well as a basic successful structure.

* Remove existing support for `use`

This will come back shortly with worlds, but for now nothing uses this
in the repository any more and it's not implemented within the resolver
so temporarily remove it.

* Thread through docs on worlds/interfaces

* Remove docs from imports/exports

They're not threaded anywhere right now so remove them. Can be added
back in if needed in the future.

* Implement temporary stopgap of `default export`

* Fix demo build

Signed-off-by: Brian H <brian.hardock@fermyon.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
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