Skip to content

Conversation

elliottt
Copy link
Member

Backport #8005 to the wasmtime 18 release branch, and update the release notes.

jameysharp and others added 2 commits February 27, 2024 18:52
We had two optimization rules which started off like this:

(rule (simplify (ireduce smallty val@(binary_op _ op x y)))
      (if-let _ (reducible_modular_op val))
      ...)

This was intended to check that `x` and `y` came from an instruction
which not only was a binary op but also matched `reducible_modular_op`.

Unfortunately, both `binary_op` and `reducible_modular_op` were
multi-terms.
- So `binary_op` would search the eclass rooted at `val` to find each
  instruction that uses a binary operator.
- Then `reducible_modular_op` would search the entire eclass again to
  find an instruction which matched its criteria.

Nothing ensured that both searches would find the same instruction.

The reason these rules were written this way was because they had
additional guards (`will_simplify_with_ireduce`) which made them fairly
complex, and it seemed desirable to not have to copy those guards for
every operator where we wanted to apply this optimization.

However, we've decided that checking whether the rule is actually an
improvement is not desirable. In general, that should be the job of the
cost function. Blindly adding equivalent expressions gives us more
opportunities for other rules to fire, and we have global recursion and
growth limits to keep the process from going too wild.

As a result, we can just delete those guards. That allows us to write
the rules in a more straightforward way.

Fixes bytecodealliance#7999.

Co-authored-by: Trevor Elliott <telliott@fastly.com>
Co-authored-by: L Pereira <l.pereira@fastly.com>
Co-authored-by: Chris Fallin <chris@cfallin.org>
@elliottt elliottt requested review from a team as code owners February 28, 2024 02:54
@elliottt elliottt requested review from fitzgen and alexcrichton and removed request for a team February 28, 2024 02:54
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language wasmtime:docs Issues related to Wasmtime's documentation labels Feb 28, 2024
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "isle", "wasmtime:docs"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.


## 18.0.1

Released 2024-02-20.
Copy link
Member

Choose a reason for hiding this comment

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

For when 18.0.2 and 17.0.2 are released mind adding these date-related "Released" entries in the notes?

(you should be able to push directly to the PR created from CI when doing that)

@alexcrichton alexcrichton merged commit dfdd28e into bytecodealliance:release-18.0.0 Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language wasmtime:docs Issues related to Wasmtime's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants