If there is a foreach chain, then you can schedule each step of the chain consecutively so that the cache from the non-final nodes in the chain can be discarded.
If, instead, we do all first steps across the foreach then we must have memory allocated for caching all of them.
If there is a foreach chain, then you can schedule each step of the chain consecutively so that the cache from the non-final nodes in the chain can be discarded.
If, instead, we do all first steps across the foreach then we must have memory allocated for caching all of them.