[haskell-llvm] Vectorize loop

Carter Schonwald carter.schonwald at gmail.com
Sun Dec 22 21:10:31 GMT 2013


Hey timo,  could you post a gist linking to the full code and example
input? What LLvm version is opt and what version of llvm general you're
using?

On Sunday, December 22, 2013, Timo von Holtz wrote:

> I tried to mimic the output I get from
>
> opt -O3 dotp.s -S -vectorize-loops
>
> using llvm-general. But somehow, I can't get it to vectorize the loop.
> This is the code I used:
>
> import LLVM.General.Context
> import LLVM.General.Module
> import Control.Monad.Error
> import LLVM.General.PassManager
> import LLVM.General.Transforms
>
> main :: IO ()
> main = do
>   mt <- readFile "dotp.s"
>   _ <- withContext $ \cx -> runErrorT $ withModuleFromString cx mt $ \modu
> -> do
>     let ps = defaultCuratedPassSetSpec {optLevel=Just 3}
>         ps1 = defaultPassSetSpec {transforms=[LoopVectorize]}
>     _ <- withPassManager ps $ \pm -> runPassManager pm modu
>     _ <- withPassManager ps1 $ \pm -> runPassManager pm modu
>     moduleString modu >>= putStrLn
>     print defaultVectorizeBasicBlocks
>   return ()
>
> Kind Regards,
> Timo von Holtz
>
> _______________________________________________
> Haskell-llvm mailing list
> Haskell-llvm at projects.haskell.org <javascript:;>
> http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-llvm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/haskell-llvm/attachments/20131222/11fb5fa0/attachment.htm>


More information about the Haskell-llvm mailing list