Description
This pass flattens into mutable fields of objects and into vectors.
For example, an (int * int) ref is represented by a 2 word object, and an (int * int) array contains pairs of ints, rather than pointers to pairs of ints.
Implementation
deep-flatten.sig deep-flatten.funDetails and Notes
There are some performance issues with the deep flatten pass, where it consumes an excessive amount of memory.
A number of applications require compilation with -drop-pass deepFlatten to avoid exceeding available memory. It is often asked whether the deep flatten pass usually has a significant impact on performance. The standard benchmark suite was run with and without the deep flatten pass enabled when the pass was first introduced:
The conclusion is that it does not have a significant impact. However, these are micro benchmarks; other applications may derive greater benefit from the pass.