Why doesn't GCC show vectorization information?

I'm using Codeblocks for a C program on Windows 7. The program is using the OMP library. GCC version is 4.9.2. Mingw x86_64-w64-mingw32-gcc-4.9.2.exe.

Flags used are: -fopenmp -O3 -mfpmath=sse -funroll-loops -ftree-loop-distribution -ftree-vectorize -ftree-vectorizer-verbose=2 .

The program runs correctly but the problem is that it doesn't show information on what loops were vectorized or not. How can I solve it?

Build log info:

-------------- Build: Release in **** (compiler: GNU GCC Compiler)---------------

x86_64-w64-mingw32-gcc-4.9.2.exe -Wall -O2 -march=corei7 -fexpensive-optimizations -O3 -fopenmp -mfpmath=sse -funroll-loops -ftree-loop-distribution -ftree-vectorize -ftree-vectorizer-verbose=2 -c C:Users...fc -o objReleasefo x86_64-w64-mingw32-g++.exe -o binReleased.exe objReleasefo objReleasemain.o -s "C:Program Files...libgomp-1.dll" Output file is binReleased.exe with size 21.00 KB Process terminated with status 0 (0 minute(s), 0 second(s)) 0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


CodeBlocks is an IDE. It doesn't compile anything. GCC does. The -ftree-vectorizer-verbose used to work in previous versions. Now there's -fopt-info , which allows to retrieve information about optimizations (vectorization too); you can find the relevant documentation here.

It is even shown how to actually retrieve the vectorizer output to stderr : and this one:

gcc -O2 -ftree-vectorize -fopt-info-vec-missed 

prints information about missed optimization opportunities from vectorization passes on stderr. Note that -fopt-info-vec-missed is equivalent to -fopt-info-missed-vec.

You can change missed to eg optimized , all and so on as listed.

链接地址: http://www.djcxy.com/p/53396.html

上一篇: VS 2017 + cmake + ninja + mingw

下一篇: 为什么GCC不显示矢量化信息?