Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebAssembly] LLVM IR add does not compile to wrapping Wasm #111018

Open
yowl opened this issue Oct 3, 2024 · 1 comment
Open

[WebAssembly] LLVM IR add does not compile to wrapping Wasm #111018

yowl opened this issue Oct 3, 2024 · 1 comment

Comments

@yowl
Copy link

yowl commented Oct 3, 2024

https://godbolt.org/z/6ETzMh11h

This LLVM uses add to add -4 to a symbol, but the Wasm, as I read it, has the $base as -4 and $offset as the symbol, this will not wrap whereas the semantic for LLVM add should wrap.

Compiling with O1 creates the correct Wasm:

https://godbolt.org/z/5W8rEMs5q

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 3, 2024

@llvm/issue-subscribers-backend-webassembly

Author: None (yowl)

https://godbolt.org/z/6ETzMh11h

This LLVM uses add to add -4 to a symbol, but the Wasm, as I read it, has the $base as -4 and $offset as the symbol, this will not wrap whereas the semantic for LLVM add should wrap.

Compiling with O1 creates the correct Wasm:

https://godbolt.org/z/5W8rEMs5q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants