bytecodealliance / bytecodealliance/wasmtime
Benchmark clearing splat register; remove XmmUninitializedValue
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 121
Description
As suggested by @bnjbvr in https://github.com/bytecodealliance/wasmtime/pull/2248#issuecomment-702627995, we should benchmark whether clearing a register with `PXOR` before emitting the sequence for `splat` will cause a slowdown on x64. Currently, #2248 adds a weird meta-instruction, `XmmUninitializedValue`, that tells the register allocator that the `dst` register is a `def`, not a `mod`, because the sequence of instructions emitted for `splat` will overwrite all lanes of `dst`. `XmmUninitializedValue` is dangerous, though, because we must be very careful to ensure the "overwrite all lanes" invariant holds--it would be preferable to remove it. One way to do so would be to initially emit a `PXOR dst, dst`, which the new backend recognizes as a `def`. I avoided this in #2248 because of increased code size, potential slowdown, and the fact that the old backend did not have it, but if we find that its emission causes no slowdown, we should add it and remove `XmmUninitializedValue`.
Contributor guide
Assessment
This issue has not been assessed yet.