Simplify scratch local calculation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @tlively and the rest of your teammates on
Graphite