Closed tmcdonell closed 10 years ago
I'd like support for adding fast math flags to floating point operations: http://llvm.org/docs/LangRef.html#fastmath
In particular, setting these flags is necessary for the auto-vectorizer to kick in and vectorize some kinds of operations, such as reductions.
At an example, here's a simple dot product file: https://gist.github.com/tmcdonell/9198757. Running through...
opt -O3 -S dotp.ll
and everything is nicely vectorized. However, if you delete the fast annotation to fmul and fadd on lines 18 and 19 respectively, then sadness ):
fast
fmul
fadd
$ opt --version LLVM (http://llvm.org/): LLVM version 3.4 Optimized build with assertions. Built Feb 19 2014 (13:32:25). Default target: x86_64-apple-darwin13.0.0 Host CPU: corei7
I too would like to see this. I tried to implement this, but I failed on the Template Haskell part.
This is what I had so far: eab5d4386ed319e9428497d6011afbf5e9c6eec4
This is now in 3.3.12.0 and 3.4.3.0.
I'd like support for adding fast math flags to floating point operations: http://llvm.org/docs/LangRef.html#fastmath
In particular, setting these flags is necessary for the auto-vectorizer to kick in and vectorize some kinds of operations, such as reductions.
At an example, here's a simple dot product file: https://gist.github.com/tmcdonell/9198757. Running through...
and everything is nicely vectorized. However, if you delete the
fast
annotation tofmul
andfadd
on lines 18 and 19 respectively, then sadness ):