AccelerateHS / AccelerateHS/accelerate

Loop-invariant code motion

Open
#271 0 comments 0 reactions 0 assignees View on GitHub
frontend new feature
Dominant language
Haskell
Stars
1k
Forks
135
PR merge metrics
No merged PRs in 30d

Description

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:

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.