SLPVectorizer: Implement DCE as part of vectorization.
authorNadav Rotem <nrotem@apple.com>
Sun, 7 Jul 2013 06:57:07 +0000 (06:57 +0000)
committerNadav Rotem <nrotem@apple.com>
Sun, 7 Jul 2013 06:57:07 +0000 (06:57 +0000)
commit2041b742d4159d95b68a744b07ff2f2c0a78868d
treeb9ded3604a0171f17d7963edae1c5ee2e2d05b16
parent8421a06314356a7e53819f9e13242bb5fb962141
SLPVectorizer: Implement DCE as part of vectorization.

This is a complete re-write if the bottom-up vectorization class.
Before this commit we scanned the instruction tree 3 times. First in search of merge points for the trees. Second, for estimating the cost. And finally for vectorization.
There was a lot of code duplication and adding the DCE exposed bugs. The new design is simpler and DCE was a part of the design.
In this implementation we build the tree once. After that we estimate the cost by scanning the different entries in the constructed tree (in any order). The vectorization phase also works on the built tree.

llvm-svn: 185774
17 files changed:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/crash_7zip.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_bullet.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_bullet2.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_flop7.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_lame.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_lencod.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_lencod2.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_rc4.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt2.ll [new file with mode: 0644]
llvm/test/Transforms/SLPVectorizer/X86/diamond.ll
llvm/test/Transforms/SLPVectorizer/X86/long_chains.ll
llvm/test/Transforms/SLPVectorizer/X86/saxpy.ll