[LLVMdev] NEON vector instructions and the fast math IR flags

Renato Golin renato.golin at linaro.org
Fri Jun 7 09:53:15 PDT 2013


On 7 June 2013 15:41, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:

> We don’t want to encode backend knowledge into the vectorizer (i.e. don’t
> vectorize type X because the backend does not support it).
>

We already do, via the cost table. This case is no different. It might not
be the best choice, but it is how the cost table is being built over the
last months.


The only way to get this result is indirectly via the cost model but the
> backend must still support vectorized IR (it is part of the language) via
> scalarization.
>

Absolutely! There are two problems to solve: increase the cost for SPFP
when UseNEONForSinglePrecisionFP is false, so that vectorizers don't
generate such code, and legalize correctly in the backend, for vector code
that does not respect that flag.


(You can of course assign UMAX cost for all floating point vector types in
> the cost model for ARM and get the desired result - this won’t solve the
> problem if somebody else writes the vectorize LLVM IR though)
>

I wouldn't use UMAX, since the idea is not to forbid, but to tell how
expensive it is. But it would be a big number, yes. ;)

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130607/439b07ec/attachment.html>


More information about the llvm-dev mailing list