Skip to content

Extend getMaxbits to handle Block type #7590

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

xuruiyang2002
Copy link
Contributor

@xuruiyang2002 xuruiyang2002 commented May 14, 2025

There is a need to extend the getMaxBits to handle the Block.

For example, wasm-opt (95808a7) cannot optimize the following code snippet

   (i32.and
    (i32.load
     (i32.const 0)
    )
    (block (result i32)
     (i32.store
      (i32.const 0)
      (i32.const 0)
     )
     (i32.const 0)
    )

to zero, the root cause is that getMaxBits fails to deal with the block.

Fixes: #7559

@xuruiyang2002
Copy link
Contributor Author

xuruiyang2002 commented May 14, 2025

Current PR is to just implement the getMaxBits for Block.

As discussed in #7559, should we bother to introduce the getFallthrough? In doing so, we'd also modify the API and the references and tests. What's more, invoking getFallthrough maybe prohibited. Because bits.h is included by properties.h before the getFallthrough function itself is defined within properties.h, which thus making it invisible at the point of the call.

@xuruiyang2002
Copy link
Contributor Author

xuruiyang2002 commented May 14, 2025

UPDATE: I've fuzzing for about three hour, and all is well.

@xuruiyang2002
Copy link
Contributor Author

Since there is a need to extend the getMaxBits to handle the Block, could you please review this PR if you have a moment? @kripken

xuruiyang2002 and others added 3 commits May 31, 2025 07:35
@xuruiyang2002
Copy link
Contributor Author

I've also fuzzing for 3 hours; and all is well.

Co-authored-by: Alon Zakai <alonzakai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants