What does too much BB in the loop mean, can't vectorize?

In short, the situation is this: I tried to compile C code with the option gcc -O2 -ftree-vectorize -msse4 -ftree-vectorizer-verbose=10 -march=core2 -g -c . For some nested for-loop constructs inside the code, gcc complains

not vectorized: too many BBs in the loop.

I apologize for my very limited understanding of compilers and vectorization.

Some initial searches caused me this result on the gcc mailing list, which says BB is an abbreviation for the building block. From there, checking the GCC internal documentation, I found that gcc uses BB to plot a control flow graph (CFG).

Can someone explain what is meant by BB in a loop?

Also, I can't relate how too much BB actually leads to the failure of gcc vectorization?

+4
source share
1 answer

BB means "base unit". See http://en.wikipedia.org/wiki/Basic_block for a more detailed explanation of what they are.

I assume that if there are too many base 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 “If there is a control flow” section, to find out why vectorization is affected.

+3
source

All Articles