Revert the switch of loop-idiom to use the new dependence analysis.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 2 Nov 2012 08:33:25 +0000 (08:33 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 2 Nov 2012 08:33:25 +0000 (08:33 +0000)
commita864748284f4bab974ffb13b840a611c1f9bc7ac
treeefa83992f67fa1c80bc3023a0c357bb0627852f7
parentd295c9729d04727666c84c4a184e8ce796dd9974
Revert the switch of loop-idiom to use the new dependence analysis.

The new analysis is not yet ready for prime time. It has a *critical*
flawed assumption, and some troubling shortages of testing. Until it's
been hammered into better shape, let's stick with the working code. This
should be easy to revert itself when the analysis is ready.

Fixes PR14241, a miscompile of any memcpy-able loop which uses a pointer
as the induction mechanism. If you have been seeing miscompiles in this
revision range, you really want to test with this backed out. The
results of this miscompile are a bit subtle as they can lead to
downstream passes concluding things are impossible which are in fact
possible.

Thanks to David Blaikie for the majority of the reduction of this
miscompile. I'll be checking in the test case in a non-revert commit.

Revesions reverted here:

r167045: LoopIdiom: Fix a serious missed optimization: we only turned
         top-level loops into memmove.
r166877: LoopIdiom: Add checks to avoid turning memmove into an infinite
         loop.
r166875: LoopIdiom: Recognize memmove loops.
r166874: LoopIdiom: Replace custom dependence analysis with
         DependenceAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167286 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
test/Transforms/LoopIdiom/basic.ll
test/Transforms/LoopIdiom/memmove.ll [deleted file]
test/Transforms/LoopIdiom/memset_noidiom.ll
test/Transforms/LoopIdiom/multi-dimensional.ll [deleted file]
test/Transforms/LoopIdiom/sideeffect.ll [deleted file]