News for hackers. Stuff that matters.
Re:Prefix Sum with SIMD by zozbot234 on Saturday February 12, 2022 @08:28AM (#30312650)
LLVM does a pretty good job of vectorizing code these days, and pretty much everything is using it. And making vectorization more effective is one of the most workable avenues for improving compiler tech.
Re:Prefix Sum with SIMD by fulafel on Saturday February 12, 2022 @08:55AM (#30312819)
Given the constraints llvm frequently does a relatively ok job with the pieces it has to work with, but the results are usually poor in absolute terms vs what manual optimizations would allow. The language semantics of c/c++ don't support the required leeway of optimization transformations (eg optimizing data layout hand in hand with it's access patterns, parallel semantics).
Re:Prefix Sum with SIMD by mandarax8 on Saturday February 12, 2022 @10:38AM (#30313551)
Are there any languages you know that do support these kinds of transformations?
Re:Prefix Sum with SIMD by fulafel on Saturday February 12, 2022 @10:50AM (#30313664)
Besides the ones mentioned in the other comment, Halide I think is a good model of the kind of approach needed, but that is somewhat domain-specific. So expressing the problem in a sufficiently abstract form that the compiler has many freedoms in organizing how the computation in concrete terms takes place. The IPSC approach seems solid as well even though it's much less ambitious and doesn't do data layout optimizations.

An important nontechnical problem with these is that there is such a long way to travel for a language to reach widespread adoption, needing credible long term sponsorship and commitment from a broad shouldered user community or private organisation, etc.

Re:Prefix Sum with SIMD by inetknght on Saturday February 12, 2022 @11:22AM (#30313916)
> c++ don't support the required leeway of optimization transformations

What transformations do you think C++ doesn't support?

I've got a _lot_ of experience in C++ and I've found that it's almost always the case that whatever library being used needs to be rewritten for a small change. Rewriting libraries is rarely approved. And further, there's often very little unit testing being done towards that end too.

Re:Prefix Sum with SIMD by fulafel on Sunday February 13, 2022 @05:38AM (#30320789)
I meant automatic optimizations done by the compiler, and limitations imposed by the language semantics.