binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Push `struct.new` down to make it more likely that heap stores can be optimized.

Open rluble opened this issue 9 months ago • 0 comments

Heap stores (struct.set) are optimized into the struct.new when they are adjacent in a statement list.

Pushing struct.new down when they are not adjacent increases the likelihood for heap stores to be optimized. Optimizing heap stores is a beneficial step in making struct fields immutable which in turn helps other various optimziations.

rluble avatar May 12 '24 17:05 rluble