icicle
icicle copied to clipboard
Reduce array copying when access is linear or affine.
We elaborate immutable Core functions to avalanche and insert extra Copy operations when updating Arrays (which are usually map ops).
This maintains correct semantics when we compile to C and have Arrays as allocated values on the heap with pointers to them.
Unfortunately though, some of these copy operations were turning up in our loops, which doesn't make a lot of sense, especially for queries like
from ... in group ... in ...
We fix this by removing copy operations which can't affect the results by tracking values which could potentially point to them and see if a binding uses it in a non-linear manner.