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.
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: Dec 23 2024 at 12:05 UTC