accelerate icon indicating copy to clipboard operation
accelerate copied to clipboard

Loop-invariant code motion

Open tmcdonell opened this issue 10 years ago • 0 comments

We don't have any form of loop-invariant code-motion implemented. At the scalar level we could assume that the backend compiler (CUDA / LLVM) will do that for us, but at the array level we are on our own (given the current approach of compiling each collective operation individually).

In the mean time, the following little hack will force a thing to be executed before moving on:

licm :: (Arrays a, Arrays b) => Acc a -> (Acc a -> Acc b) -> Acc b
licm x f  = (id >-> f) x

tmcdonell avatar Jun 03 '15 02:06 tmcdonell