循环中 BB 太多,无法矢量化是什么意思?
简而言之,情况是这样的:我一直在尝试使用选项 gcc -O2 -ftree-vectorize -msse4 -ftree-vectorizer-verbose=10 -march=core2 -g -c 编译 C 代码。对于代码中的某些嵌套 for 循环结构,gcc 抱怨
未矢量化:循环中有太多 BB。
对于我对编译器和矢量化的非常有限的理解,我深表歉意。
一些初步搜索在 gcc 的邮件列表中为我提供了这个结果,其中显示 BB 是构建块的缩写。从那里检查 GCC 内部文档我发现 gcc 使用 BB 来构建控制流图(CFG)。
有人可以解释一下循环中的 BB 是什么意思吗?
另外,我无法确定有多少 BB 实际上导致 gcc 矢量化失败?
In short, the situation is this: I have been trying to compile a C code with option gcc -O2 -ftree-vectorize -msse4 -ftree-vectorizer-verbose=10 -march=core2 -g -c
. For certain nested for-loop constructs inside the code gcc complains
not vectorized: too many BBs in loop.
I apologize for my very limited understanding on compilers and vectorization.
Some initial searching fetched me this result in gcc's mailing list which says BB is an acronym for building block. From there checking GCC internals documentation I found out that gcc uses BB's to construct Control flow graph (CFG).
Can somebody please explain what is meant by BB's in the loop?
Also, I can't relate how too many BB's is actually making the gcc vectorization to fail?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BB 的意思是“基本块”。有关它们的更多说明,请参阅 http://en.wikipedia.org/wiki/Basic_block 。
我想如果有太多的基本块,控制流就会导致无法对操作进行矢量化。请参阅 http://en.wikipedia.org/wiki/Vectorization_(parallel_computing) 和特别是“存在控制流”部分,了解矢量化受到影响的原因。
BB means "basic block". See http://en.wikipedia.org/wiki/Basic_block for more explanation of what they are.
I imagine if there are too many basic blocks the control flow is such that it makes it impossible to vectorize the operation. See http://en.wikipedia.org/wiki/Vectorization_(parallel_computing) and in particular the section on "In the presence of control flow" to see why vectorization is affected.