4 ms·
+1 for restrict, that certainly helps. Out of curiosity, what's your use case where autovectorization works well? Personally, I have often been disappointed. N
by janwas 6y ago
+1 for restrict, that certainly helps. Out of curiosity, what's your use case where autovectorization works well?
Personally, I have often been disappointed. Not much progress in 2 years: http://www.0x80.pl/notesen/2021-01-18-autovectorization-gcc-clang.html http://www.0x80.pl/notesen/2021-01-18-autovectorization-gcc-...
- kolbe 6y agoI'll admit that there are times when I am both stunned at how well the compiler will optimize, and times when I'm stunned at how poorly it does. It would seem you can never make an assumption on what will happen--hence my addiction to godbolt. I don't have my exact code, but I work heavily with math operations, so it may be that I do encounter an especially easy types of loops to vectorize.
- janwas 6y agoOK, that's fair. Godbolt is a great tool and autovectorization gets initial results quickly, but the price is eternal vigilance. Any compiler update/code maintenance risks falling on the wrong side of some compiler heuristic.