You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wasm-opt (862aeb9) eliminates the dead br_if body by -all -O2 but can not do that by -all -O3.
After analysis, O3 performs one more local-cse than O2, thus introducing local.tee (e.g., combining local.set + local.get). However, it also introduces side effect, which blocks constant propagation and then finally blocks DCE
Specifically, through local-cse, wasm-opt transforms the condition (always false) of br_if statements from
does not get optimized. The two inputs are equal, so we can optimize it, but the local.tee confuses us.
Looks like that happens in optimizeBinaryWithEqualEffectlessChildren, which should be renamed and made to handle children with effects. We can do that by using areConsecutiveInputsEqual, which handles the tee/get pattern.
Given the following code:
wasm-opt (862aeb9) eliminates the dead
br_if
body by-all -O2
but can not do that by-all -O3
.After analysis, O3 performs one more
local-cse
than O2, thus introducinglocal.tee
(e.g., combininglocal.set
+local.get
). However, it also introduces side effect, which blocks constant propagation and then finally blocks DCESpecifically, through
local-cse
, wasm-opt transforms the condition (always false) ofbr_if
statements fromto
thus blocking the constant propagation, leading to DCE missed optimization.
Overall, I think it is a missed optimization.
The text was updated successfully, but these errors were encountered: