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

Remove Peepmatic!!! #3543

Merged
merged 1 commit into from
Nov 17, 2021
Merged

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Nov 17, 2021

Peepmatic was an early attempt at a DSL for peephole optimizations, with the
idea that maybe sometime in the future we could user it for instruction
selection as well. It didn't really pan out, however:

  • Peepmatic wasn't quite flexible enough, and adding new operators or snippets
    of code implemented externally in Rust was a bit of a pain.

  • The performance was never competitive with the hand-written peephole
    optimizers. It was very size efficient, but that came at the cost of
    run-time efficiency. Everything was table-based and interpreted, rather than
    generating any Rust code.

Ultimately, because of these reasons, we never turned Peepmatic on by default.

These days, we just landed the ISLE domain-specific language, and it is better
suited than Peepmatic for all the things that Peepmatic was originally designed
to do. It is more flexible and easy to integrate with external Rust code. It is
has better time efficiency, meeting or even beating hand-written code. I think a
small part of the reason why ISLE excels in these things is because its design
was informed by Peepmatic's failures. I still plan on continuing Peepmatic's
mission to make Cranelift's peephole optimizer passes generated from DSL rewrite
rules, but using ISLE instead of Peepmatic.

Thank you Peepmatic, rest in peace!

Peepmatic was an early attempt at a DSL for peephole optimizations, with the
idea that maybe sometime in the future we could user it for instruction
selection as well. It didn't really pan out, however:

* Peepmatic wasn't quite flexible enough, and adding new operators or snippets
  of code implemented externally in Rust was a bit of a pain.

* The performance was never competitive with the hand-written peephole
  optimizers. It was *very* size efficient, but that came at the cost of
  run-time efficiency. Everything was table-based and interpreted, rather than
  generating any Rust code.

Ultimately, because of these reasons, we never turned Peepmatic on by default.

These days, we just landed the ISLE domain-specific language, and it is better
suited than Peepmatic for all the things that Peepmatic was originally designed
to do. It is more flexible and easy to integrate with external Rust code. It is
has better time efficiency, meeting or even beating hand-written code. I think a
small part of the reason why ISLE excels in these things is because its design
was informed by Peepmatic's failures. I still plan on continuing Peepmatic's
mission to make Cranelift's peephole optimizer passes generated from DSL rewrite
rules, but using ISLE instead of Peepmatic.

Thank you Peepmatic, rest in peace!
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:peepmatic cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. labels Nov 17, 2021
@github-actions
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "cranelift", "cranelift:area:peepmatic", "cranelift:area:x64", "cranelift:meta"

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

  • fitzgen: cranelift:area:peepmatic

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

Learn more.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

🍗

@fitzgen fitzgen merged commit 5bb1ea5 into bytecodealliance:main Nov 17, 2021
@fitzgen fitzgen deleted the remove-peepmatic branch November 17, 2021 21:55
@cfallin
Copy link
Member

cfallin commented Nov 17, 2021

Peepmatic indeed was a very informative design point that fed into our current work on ISLE, and the time spent on it was well-spent and very useful. Thanks for the efforts and sorry to see it go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants