Skip to content

Fix fallback-split behavior: trim start of minimal bundle wrt start of original LR.#85

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
cfallin:fix-minimal-bundle-split-start
Sep 22, 2022
Merged

Fix fallback-split behavior: trim start of minimal bundle wrt start of original LR.#85
cfallin merged 1 commit intobytecodealliance:mainfrom
cfallin:fix-minimal-bundle-split-start

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Sep 22, 2022

When a liverange starts at a late point of an instruction, and it undergoes the fallback "split into all minimal pieces" transform, we end up creating one minimal bundle that starts at the early point of the instruction at the start of the original LR. This can create impossible-to-allocate situations where a fixed-constraint LR overlaps another constrained to the same register (e.g. at calls). We fix this by ensuring the minimal bundle is trimmed only to the half of the instruction that overlaps the original LR.

This is analogous to the third fix in #74, but on the other end (start of LR rather than end of it).

…f original LR.

When a liverange starts at a *late* point of an instruction, and it
undergoes the fallback "split into all minimal pieces" transform, we end
up creating one minimal bundle that starts at the *early* point of the
instruction at the start of the original LR. This can create
impossible-to-allocate situations where a fixed-constraint LR overlaps
another constrained to the same register (e.g. at calls). We fix this by
ensuring the minimal bundle is trimmed only to the half of the
instruction that overlaps the original LR.

This is analogous to the third fix in bytecodealliance#74, but on the other end (start
of LR rather than end of it).
@cfallin
Copy link
Copy Markdown
Member Author

cfallin commented Sep 22, 2022

This fixes a fuzzbug (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51699 for those with access) and thus a compile panic on main; hopefully we can get it merged soon :-) Happy to talk through the fuzz case if anyone would like that.

Copy link
Copy Markdown
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I actually understood this one!

@cfallin cfallin merged commit bcfc10c into bytecodealliance:main Sep 22, 2022
@cfallin cfallin deleted the fix-minimal-bundle-split-start branch September 22, 2022 22:09
@cfallin cfallin mentioned this pull request Sep 22, 2022
cfallin added a commit to cfallin/wasmtime that referenced this pull request Sep 22, 2022
Incorporates bytecodealliance/regalloc2#85, which fixes a fuzzbug
related to constraints and liverange splits.
cfallin added a commit to bytecodealliance/wasmtime that referenced this pull request Sep 23, 2022
* Upgrade to regalloc2 0.4.1.

Incorporates bytecodealliance/regalloc2#85, which fixes a fuzzbug
related to constraints and liverange splits.

* Add audit of regalloc2 upgrade.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants