4 ms·
It's not just aliasing. gcc is quite bad at autovectorising in general, clang is much better. Here's a trivial algorithm that gcc borks over because 'bool' is
by secondcoming 3y ago
It's not just aliasing. gcc is quite bad at autovectorising in general, clang is much better.
Here's a trivial algorithm that gcc borks over because 'bool' is used instead of 'int', even fixing that the codegen isn't great:
https://godbolt.org/z/hf7szo78E https://godbolt.org/z/hf7szo78E
- harry8 3y agoReally good example. It also sucks that you have no way of knowing at build time whether autovectorisation succeeded. Even if you have it working initially it can silently break and you don't know where. So using clang, you're careful and you check the generated code and everything is great, then later it isn't and you have to go hunting to find out why.