Stream: cranelift

Topic: division optimisation


view this post on Zulip Kirp (Jul 22 2025 at 20:51):

Saw division optimisations were added in #11129 - remember previously these were blocked as division wasn’t rewritten I believe due to possible side effects - interested in learning how this was now achieved !

view this post on Zulip Kirp (Jul 22 2025 at 20:54):

Guess PR#10524 is a starting point?

view this post on Zulip fitzgen (he/him) (Jul 23 2025 at 14:59):

Yes, Initial support was added in https://github.com/bytecodealliance/wasmtime/pull/10524 and there have been one or two follow up PRs adding rules since then. Don’t have those links handy but you should be able to just git log the cranelift/src/opts subdirectory since there hasn’t been too much other stuff in there recently

This commit adds a new top-level ISLE entrypoint specifically for instructions in the side-effectful skeleton: simplify_skeleton. While these rewrites are processed during the egraph pass, values f...

view this post on Zulip fitzgen (he/him) (Jul 23 2025 at 15:00):

https://github.com/bytecodealliance/wasmtime/pull/11129 Was the PR for division specifically

Revive the old module for generating division-by-constant magic numbers Add proptests for divide-by-constant magic number generators, just for a little extra correctness assurances Apply divisi...

Last updated: Dec 06 2025 at 07:03 UTC