[LLVMdev] On large vectors

David Tweed david.tweed at arm.com
Thu Feb 7 02:00:54 PST 2013


> 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?

As a pragmatic approach to developing things, I'd say that it's best to view LLVM as a compiler that won't change your code in big ways (even if one or two passes/plugins might). So to rely on the autovectorizer you really want to be producing code that is easy to for it to determine is vectorizable. So while your code-generator may not actually be using vectors, I'd think you'd need to be thinking about vectorizability throughout it to be aware of the way you're expressing things in LLVM IR. I'd be particularly wary of using arrays with loops on each "conceptual vector" operation, since the compiler may well fail to fuse the loops and hence see the opportunities. (But then I've been thinking a lot about loop fusion recently, so there's possibly an idée fixe there.)

Regards,
Dave 







More information about the llvm-dev mailing list