We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given the following code:
(module (import "External" "external_function" (func $external_function )) (func $_start (result i32) i32.const 0 i32.const 0 call $func ) (func $func(param $1 i32) (param $2 i32) (result i32) call $foo i32.const 1 i32.and local.set $2 i32.const 0 local.set $1 local.get $2 i32.const 1 i32.or if (result i32) ;; label = @1 local.get $1 else call $external_function i32.const 0 end) (func $foo (result i32) i32.const 0 i32.load) (memory $0 258 258) (export "_start" (func $_start)))
wasm-opt (c528c7e) can eliminate deduce the condition to be true by -all -O2, however, can not by -all -O3. Thus blocking the DCE of the false branch.
wasm-opt
-all -O2
-all -O3
Analysis: probably the issues lies in OptimizeInstructions, the rule for bool(x) | 1 ==> 1. Currently wasm-opt cannot handle x with side-effect.
OptimizeInstructions
bool(x) | 1 ==> 1
x
Fix: use any instead of pure.
any
pure
The text was updated successfully, but these errors were encountered:
opt for WebAssembly#7477
17e681a
e6f1c53
Successfully merging a pull request may close this issue.
Given the following code:
wasm-opt
(c528c7e) can eliminate deduce the condition to be true by-all -O2
, however, can not by-all -O3
. Thus blocking the DCE of the false branch.Analysis: probably the issues lies in
OptimizeInstructions
, the rule forbool(x) | 1 ==> 1
. Currently wasm-opt cannot handlex
with side-effect.Fix: use
any
instead ofpure
.The text was updated successfully, but these errors were encountered: