cfallin opened PR #6167 from cfallin:remove-non-egraphs
to bytecodealliance:main
:
This PR removes the LICM, GVN, and preopt passes, and associated support pieces, from
cranelift-codegen
. Not to worry, we still have optimizations: the egraph framework subsumes all of these, and has been on by default since #5181.A few decision points:
Filetests for the legacy LICM, GVN and simple_preopt were removed too. As we built optimizations in the egraph framework we wrote new tests for the equivalent functionality, and many of the old tests were testing specific behaviors in the old implementations that may not be relevant anymore. However if folks prefer I could take a different approach here and try to port over all of the tests.
The corresponding filetest modes (commands) were deleted too. The
test alias_analysis
mode remains, but no longer invokes a separate GVN first (since there is no separate GVN that will not also do alias analysis) so the tests were tweaked slightly to work with that. The egrpah testsuite also covers alias analysis.The
divconst_magic_numbers
module is removed since it's unused withoutsimple_preopt
, though this is the one remaining optimization we still need to build in the egraphs framework, pending #5908. The magic numbers will live forever in git history so removing this in the meantime is not a major issue IMHO.The
use_egraphs
setting itself was removed at both the Cranelift and Wasmtime levels. It has been marked deprecated for a few releases now (Wasmtime 6.0, 7.0, upcoming 8.0, and corresponding Cranelift versions) so I think this is probably OK. As an alternative if anyone feels strongly, we could leave the setting and make it a no-op.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
cfallin requested elliottt for a review on PR #6167.
cfallin requested wasmtime-compiler-reviewers for a review on PR #6167.
cfallin requested alexcrichton for a review on PR #6167.
cfallin requested wasmtime-core-reviewers for a review on PR #6167.
cfallin requested fitzgen for a review on PR #6167.
cfallin requested jameysharp for a review on PR #6167.
fitzgen submitted PR review.
alexcrichton submitted PR review.
elliottt submitted PR review.
elliottt created PR review comment:
I think we're still unable to port this optimization to egraphs. That shouldn't block this PR, but it would be nice to optimize control flow in the future as well :)
elliottt submitted PR review.
cfallin updated PR #6167.
cfallin submitted PR review.
cfallin created PR review comment:
Ah, yes, it looks like this is doing
(brif (icmp eq a 0) ...)
->(brif a ...)
and the equivalent forne
-- that would indeed be useful to have someday!
jameysharp submitted PR review.
jameysharp created PR review comment:
Specifically, that issue is tracked in #6106.
cfallin merged PR #6167.
Last updated: Nov 22 2024 at 17:03 UTC