[haskell-llvm] Vectorize loop
Timo von Holtz
tvh at tvholtz.de
Tue Dec 24 10:46:20 GMT 2013
First the gist with the full code:
https://gist.github.com/tvh/8111497
% opt --version
LLVM (http://llvm.org/):
LLVM version 3.3
Optimized build.
Built Jun 13 2013 (12:42:23).
Default target: x86_64-unknown-linux-gnu
Host CPU: x86-64
% ls -lA ~/.cabal/lib/x86_64-linux-ghc-7.6.3/ | grep llvm-general
drwxr-xr-x 4 tvh tvh 4096 22. Dez 14:49 llvm-general-3.3.8.2/
drwxr-xr-x 3 tvh tvh 4096 22. Dez 14:48 llvm-general-pure-3.3.8.2/
On 24 December 2013 11:45, Timo von Holtz <tvh at tvholtz.de> wrote:
> First the gist with the full code:
> https://gist.github.com/tvh/8111497
>
> % opt --version
> LLVM (http://llvm.org/):
> LLVM version 3.3
> Optimized build.
> Built Jun 13 2013 (12:42:23).
> Default target: x86_64-unknown-linux-gnu
> Host CPU: x86-64
>
> % ls -lA ~/.cabal/lib/x86_64-linux-ghc-7.6.3/ | grep llvm-general
> drwxr-xr-x 4 tvh tvh 4096 22. Dez 14:49 llvm-general-3.3.8.2/
> drwxr-xr-x 3 tvh tvh 4096 22. Dez 14:48 llvm-general-pure-3.3.8.2/
>
> On 22 December 2013 22:10, Carter Schonwald <carter.schonwald at gmail.com> wrote:
>> 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
>>> http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-llvm
More information about the Haskell-llvm
mailing list