I'd like to write some code which can be vectorized and I'd like to know that it stays that way. Does GCC have such a check? I saw that LLVM has one (that generates a warning anyway).
Asked
Active
Viewed 55 times
4
-
`#pragma GCC optimize`? – justANewb stands with Ukraine Feb 04 '23 at 01:18
-
what does the warning/error look like if it was unable to vectorize it? – dromodel Feb 04 '23 at 01:20
-
AFAIK, you can hint to GCC that this can be vectorized, but you can't force it – justANewb stands with Ukraine Feb 04 '23 at 01:24
-
It's an old answer and I'm not sure if it's still relevant. It basically says no. There's no way to assert that vectorization occurred. – dromodel Feb 04 '23 at 02:34
-
1there's no pragma but you can tell gcc to print auto-vectorization "warnings" with `-fopt-info-vec-missed`. [Why doesn't GCC show vectorization information?](https://stackoverflow.com/a/68719306/995714) – phuclv Feb 04 '23 at 07:21