Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heap2Local: Optimize Arrays in addition to Structs (#6478)
To keep things simple, this adds a Array2Struct component to the pass. When we find a non-escaping array, we run that to turn it into a struct, and then run the existing Struct2Local to convert that to locals. This avoids refactoring Struct2Local to handle both structs and arrays (with the downside of making the optimization of arrays a little less efficient, but they are rarer, I suspect - that is certainly the case in Java output I've seen). The core EscapeAnalyzer logic is generalized to handle both arrays and structs, but the changes there are thankfully quite minor.
- Loading branch information