BBVectorize: Cap the number of candidate pairs in each instruction group
authorHal Finkel <hfinkel@anl.gov>
Fri, 15 Feb 2013 04:28:42 +0000 (04:28 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 15 Feb 2013 04:28:42 +0000 (04:28 +0000)
commit283f4f0e66f547b96dcc86e649c2ef393029ea44
treeaf14dcb59d819bba6918505de4950e2a6c2c1e2c
parent08b088dbbe7716039088930e4f0a25c497f64546
BBVectorize: Cap the number of candidate pairs in each instruction group

For some basic blocks, it is possible to generate many candidate pairs for
relatively few pairable instructions. When many (tens of thousands) of these pairs
are generated for a single instruction group, the time taken to generate and
rank the different vectorization plans can become quite large. As a result, we now
cap the number of candidate pairs within each instruction group. This is done by
closing out the group once the threshold is reached (set now at 3000 pairs).

Although this will limit the overall compile-time impact, this may not be the best
way to achieve this result. It might be better, for example, to prune excessive
candidate pairs after the fact the prevent the generation of short, but highly-connected
groups. We can experiment with this in the future.

This change reduces the overall compile-time slowdown of the csa.ll test case in
PR15222 to ~5x. If 5x is still considered too large, a lower limit can be
used as the default.

This represents a functionality change, but only for very large inputs
(thus, there is no regression test).

llvm-svn: 175251
llvm/include/llvm/Transforms/Vectorize.h
llvm/lib/Transforms/Vectorize/BBVectorize.cpp