Stream: git-wasmtime

Topic: wasmtime / issue #3468 Suboptimal behavior in branch simp...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2021 at 18:50):

cfallin opened issue #3468:

In #3441, a fuzz testcase was found to produce seemingly-quadratic behavior in compiler performance. Part of this was found to be in the register allocator and fixed in that issue; but there is an additional component that appears to be in the branch simplification logic in MachBuffer.

Specifically, the simplification algorithm tracks all labels that alias the current buffer tail, and this list grows to thousands of labels when the thousands of empty Wasm loops in the fuzz testcase are processed and collapse into a "goto next instruction".

It's likely that we can short-circuit the quadratic behavior by having a fallback mode in which we track that we know nothing about the buffer tail, which inhibits any optimizations (branch chomping) from occurring.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2021 at 20:37):

cfallin closed issue #3468:

In #3441, a fuzz testcase was found to produce seemingly-quadratic behavior in compiler performance. Part of this was found to be in the register allocator and fixed in that issue; but there is an additional component that appears to be in the branch simplification logic in MachBuffer.

Specifically, the simplification algorithm tracks all labels that alias the current buffer tail, and this list grows to thousands of labels when the thousands of empty Wasm loops in the fuzz testcase are processed and collapse into a "goto next instruction".

It's likely that we can short-circuit the quadratic behavior by having a fallback mode in which we track that we know nothing about the buffer tail, which inhibits any optimizations (branch chomping) from occurring.


Last updated: Nov 22 2024 at 16:03 UTC