jameysharp requested cfallin for a review on PR #8853.
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 redundantcmp
/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.
jameysharp requested pchickey for a review on PR #8853.
jameysharp requested wasmtime-core-reviewers for a review on PR #8853.
alexcrichton submitted PR review.
alexcrichton merged PR #8853.
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