binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Optimize binary operators with equal children even if side effect

Open xuruiyang2002 opened this issue 10 months ago • 0 comments

Currently, wasm-opt cannot deduce the following code to zero because the children have side effects. However, performing the deduction while preserving the side effects is acceptable.

   (i32.ne
    (local.tee $0
     (i32.add
      (local.get $0)
      (i32.const 4059)
     )
    )
    (local.get $0)
   )

Fixes: #7440

xuruiyang2002 avatar Apr 07 '25 13:04 xuruiyang2002