Skip to content

[WebAssembly] Don't stackify multi-def instructions (#200429) - #3

Merged
Arshia001 merged 1 commit into
wasix-22.1.8from
fix/wide-arithmetic-overflow-22
Aug 6, 2026
Merged

[WebAssembly] Don't stackify multi-def instructions (#200429)#3
Arshia001 merged 1 commit into
wasix-22.1.8from
fix/wide-arithmetic-overflow-22

Conversation

@kilyanni

@kilyanni kilyanni commented Aug 6, 2026

Copy link
Copy Markdown

This commit updates the WebAssemblyRegStackify.cpp pass to specifically exclude attempting to stackify the first def of a multi-def instruction. As the previous comments indicate this is possible to do in some situations, but the current logic is incomplete and has led to miscompilations such as llvm#98323 and llvm#199910. One option would be to make the logic more robust, but in lieu of that in the meantime the change here is to completely disable stackification in these situations. This provides at least a "known working" base to build on later and fixes the known regressions around this.

Closes llvm#98323
Closes llvm#199910

Backport to LLVM 21.1.2. Adapt the multivalue.ll REGS check to the older WebAssembly register-printer syntax.

(cherry picked from commit b472674)

This commit updates the `WebAssemblyRegStackify.cpp` pass to
specifically exclude attempting to stackify the first def of a multi-def
instruction. As the previous comments indicate this is possible to do in
some situations, but the current logic is incomplete and has led to
miscompilations such as llvm#98323 and llvm#199910. One option would be to make
the logic more robust, but in lieu of that in the meantime the change
here is to completely disable stackification in these situations. This
provides at least a "known working" base to build on later and fixes the
known regressions around this.

Closes llvm#98323
Closes llvm#199910

Backport to LLVM 21.1.2. Adapt the multivalue.ll REGS check to the older WebAssembly register-printer syntax.

(cherry picked from commit b472674)
@Arshia001
Arshia001 merged commit 3f3e05c into wasix-22.1.8 Aug 6, 2026
2 checks passed
@kilyanni
kilyanni deleted the fix/wide-arithmetic-overflow-22 branch August 6, 2026 12:21
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.

3 participants