Allow BBVectorize to form non-2^n-length vectors.
authorHal Finkel <hfinkel@anl.gov>
Thu, 28 Jun 2012 05:42:42 +0000 (05:42 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 28 Jun 2012 05:42:42 +0000 (05:42 +0000)
commit64e1b28643d87e70734deb5f3d2d298e859c2fd2
treea70a8733b8b5349addc614960e0aa16be2993f25
parentec4e85e3364f50802f2007e4b1e23661d4610366
Allow BBVectorize to form non-2^n-length vectors.

The original algorithm only used recursive pair fusion of equal-length
types. This is now extended to allow pairing of any types that share
the same underlying scalar type. Because we would still generally
prefer the 2^n-length types, those are formed first. Then a second
set of iterations form the non-2^n-length types.

Also, a call to SimplifyInstructionsInBlock has been added after each
pairing iteration. This takes care of DCE (and a few other things)
that make the following iterations execute somewhat faster. For the
same reason, some of the simple shuffle-combination cases are now
handled internally.

There is some additional refactoring work to be done, but I've had
many requests for this feature, so additional refactoring will come
soon in future commits (as will additional test cases).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159330 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Vectorize.h
lib/Transforms/Vectorize/BBVectorize.cpp
test/Transforms/BBVectorize/simple.ll
test/Transforms/BBVectorize/simple3.ll [new file with mode: 0644]