Detect successful auto-vectorization
All C++ compilers that support automatic vectorization allow some report (*) being emitted during compilation to verify if a loop was vectorized, each with their own compilation flag and format in the vectorization report.
I can enable the corresponding compilation flag and visually inspect the report to check if a loop that I expect to be auto-vectorized was indeed auto-vectorized.
I would like to incorporate in my CMake build a step that checks this report automatically and fails the build if it didn't auto-vectorize.
If there was a way to pipe the output of compilation into a custom command, then I could write a small script to detect the expected output of the vectorization report.
How can I do this in CMake?
Thanks in advance
gcc https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html