binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Simplify scratch local calculation

Open tlively opened this issue 1 year ago • 1 comments

Change countScratchLocals to return the count and type of necessary scratch locals. It used to encode them as keys in the global map from scratch local types to local indices, which could not handle having more than one scratch local of a given type and was generally harder to reason about due to its use of global state. Take the opportunity to avoid emitting unnecessary scratch locals for TupleExtract expressions that will be optimized to not use them.

Also simplify and better document the calculation of the mapping from IR indices to binary indices for all locals, scratch and non-scratch.

tlively avatar May 12 '24 07:05 tlively

  • #6589 Graphite
  • #6579 Graphite
  • #6583 Graphite 👈
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tlively and the rest of your teammates on Graphite Graphite

tlively avatar May 12 '24 07:05 tlively