Stream: git-wasmtime

Topic: wasmtime / PR #8853 wasmtime: Remove redundant epoch chec...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 20:51):

jameysharp requested cfallin for a review on PR #8853.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 20:51):

jameysharp opened PR #8853 from jameysharp:epoch-entry to bytecodealliance:main:

The epoch interruption implementation caches the current deadline in a register, and avoids reloading that cache until the cached deadline has passed.

However, the first epoch check happens immediately after the cache has been populated on function entry, so there's never a reason to reload the cache at that point. It only needs to be reloaded in loops. So this commit eliminates the double-check on function entry.

When Cranelift optimizations are enabled, the alias analysis pass correctly detected that this load was redundant, and the egraph pass optimized away the icmp as well. However, since we don't do conditional constant propagation, the branch couldn't be optimized away. On x86 this lowered to a redundant cmp/jae pair of instructions in every function entry, which this commit eliminates.

To keep track of what code we're generating for epoch interruptions, I've also added disas tests with a trivial infinite loop.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 20:51):

jameysharp requested pchickey for a review on PR #8853.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 20:51):

jameysharp requested wasmtime-core-reviewers for a review on PR #8853.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 21:10):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 21:24):

alexcrichton merged PR #8853.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 20 2024 at 21:47):

cfallin commented on PR #8853:

Ah, I've wondered where that stray branch came from but never tracked it down -- thanks for finding this!


Last updated: Dec 23 2024 at 12:05 UTC