Skip to content

asm2wasm not folding away some redundant type coercions #17

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

Closed
ghost opened this issue Dec 21, 2015 · 5 comments
Closed

asm2wasm not folding away some redundant type coercions #17

ghost opened this issue Dec 21, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 21, 2015

Spotted at lot of (i32.shr_u <exp> 0) operations. Most are probably a remnant of asm.js style and should be removed?

For example: (i32.gt_u (i32.shr_u (get_local $i3) (i32.const 0)) (i32.shr_u (get_local $i1) (i32.const 0))))

@kripken
Copy link
Member

kripken commented Dec 21, 2015

Yes, we should remove those. What source code led to them?

@ghost
Copy link
Author

ghost commented Dec 21, 2015

Emscripten generated asm.js for the zlib benchmark. This example looks like asm.js if (i3 >>> 0 > i1 >>> 0) ... Any asm.js unsigned operators might has similar issues.

@kripken
Copy link
Member

kripken commented Dec 21, 2015

I see, thanks, looks like for calls and returns we look through the coercions, but for comparisons specifically we don't. Looking into that now.

@kripken
Copy link
Member

kripken commented Dec 21, 2015

Ok, the issue wasn't comparisons, but rather that we had the look-through logic for |0 but not >>>0. Fixed on master. Thanks again for filing!

@kripken kripken closed this as completed Dec 21, 2015
@kripken
Copy link
Member

kripken commented Dec 21, 2015

Forgot to add the issue # in the commit, it was this: 2654fe2

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

No branches or pull requests

1 participant