[LLVMdev] On large vectors
David Given
dg at cowlark.com
Wed Feb 6 10:02:33 PST 2013
Renato Golin wrote:
[...]
> I can see why freakishly large vectors would produce bad code. The
> type <50 x float> would be widened to the next power of two, and
> then split over and over again until it fits into registers. So,
> any <50 x float> would take 16 XMM registers, that will be spilled.
> The situation with integer types is even worse because you can
> truncate or extend from one type to another.
>
> In that sense, an inner loop with sequential access would be vectorized
> into much better code than having a <50 x float>.
>
> Whether this is something LLVM could do with <50 x float> or should
> always be up to the front-end developer, I don't know. It doesn't seem
> particularly hard to do it in the vectorizer, but it's also probably
> won't be high on the TODO list for a while.
I have actually been reading up on the vectorizer. I'm using LLVM 3.2,
so the vectorizer isn't turned on by default. Would it be feasible to
explicitly *not* use vectors --- switching to aggregates instead --- and
then rely on the vectorizer to autovectorize the code where appropriate?
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ 𝕻𝖍'𝖓𝖌𝖑𝖚𝖎 𝖒𝖌𝖑𝖜'𝖓𝖆𝖋𝖍 𝕮𝖙𝖍𝖚𝖑𝖍𝖚 𝕽'𝖑𝖞𝖊𝖍
𝖜𝖌𝖆𝖍'𝖓𝖆𝖌𝖑 𝖋𝖍𝖙𝖆𝖌𝖓.
│
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130206/91ec9bc0/attachment.sig>
More information about the llvm-dev
mailing list