I am compiling my code using following command:
gcc -O3 -ftree-vectorizer-verbose=6 -msse4.1 -ffast-math
With this all the optimizations are enabled.
But I want to disable vectorization while keeping the other optimizations.
I am compiling my code using following command:
gcc -O3 -ftree-vectorizer-verbose=6 -msse4.1 -ffast-math
With this all the optimizations are enabled.
But I want to disable vectorization while keeping the other optimizations.
you can also selectively enable and disable vectorization with the optimize function attributes or pragmas
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html
e.g.
Most of the GCC switches can be used with a
no
prefix to disable their behavior. Try with-fno-tree-vectorize
(after-O3
on the command line).Excellent, now that gcc has become more aggressive at vectorizing e.g.
In the case posted above, removing
restrict
used to do the job, but now g++ 6.0 can't be stopped from vectorizing by removing__restrict
.