为什么GCC不显示矢量化信息? [英] Why doesn't GCC show vectorization information?

查看:116
本文介绍了为什么GCC不显示矢量化信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上将Codeblocks用于C程序.该程序正在使用OMP库. GCC版本是4.9.2. Mingw x86_64-w64-mingw32-gcc-4.9.2.exe.

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.

使用的标记为:-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?

构建日志信息:

--------------构建:在****中发布(编译器:GNU GCC编译器)---------------

-------------- 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 obj \ Release \ fo x86_64-w64-mingw32-g ++.exe -o bin \ Release \ d.exe obj \ Release \ f.o obj \ Release \ main.o -s "C:\ Program 文件... \ libgomp-1.dll" 输出文件为bin \ Release \ d.exe,大小为21.00 KB进程 终止,状态为0(0分钟,0秒)0错误,0 警告(0分钟,0秒)

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...\f.c -o obj\Release\f.o x86_64-w64-mingw32-g++.exe -o bin\Release\d.exe obj\Release\f.o obj\Release\main.o -s "C:\Program Files...\libgomp-1.dll" Output file is bin\Release\d.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是一个IDE.它不会编译任何东西.海湾合作委员会这样做. -ftree-vectorizer-verbose用于以前的版本.现在有-fopt-info,它可以检索有关优化的信息(也可以进行矢量化).您可以在此处找到相关文档.

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.

甚至显示了如何实际将矢量化器输出检索到stderr: 还有这个:

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

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

打印有关矢量化错过的优化机会的信息 通过stderr.请注意,-fopt-info-vec-missed等效于 -fopt-info-missed-vec.

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

您可以将missed更改为例如列出的optimizedall等.

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

这篇关于为什么GCC不显示矢量化信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆