futhark-0.9.1: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Optimise.MemoryBlockMerging.Reuse.AllocationSizeMovingUp

Description

Move size variables used in allocation statements upwards in the bodies of a program to enable more memory block reuses.

This should be run *before* the reuse pass, as it enables more optimisations. Specifically, it helps with reusing memory whose size needs to be changed to be the maximum of itself and another size -- and so, that other size needs to have been hoisted so that is in scope at that point. This module hoists all sizes as much as possible.

Documentation