4 ms·
Maybe, but in my experience gcc is, and clang to a lesser extent, is notoriously useless at autovectorisation unless you hold its hand all the way. Even things
by secondcoming 3y ago
Maybe, but in my experience gcc is, and clang to a lesser extent, is notoriously useless at autovectorisation unless you hold its hand all the way.
Even things like changing an ‘int’ to a ‘bool’ can throw it off completely.
- ashvardanian 3y agoThat matches my experience, and goes beyond GCC and Clang. Between 2018 and 2020 I was giving a lot of lectures on this topic and we did a bunch of case studies with Intel on their older ICC and what later became the OneAPI. Short story, unless you are doing trivial data-parallel operations, like in SimSIMD, compilers are practically useless. As a proof, I wrote what is now the StringZilla library (https://github.com/ashvardanian/stringzilla https://github.com/ashvardanian/stringzilla) and we've spent weeks with an Intel team, tuning the compiler, no result. So if you are processing a lot of strings, or variable-length coded data, like compression/decompression, hand-written SIMD kernels are pretty much unbeatable.