LoopVectorizer: A reduction that has multiple uses of the reduction value is not
authorArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 19 Jan 2014 03:18:31 +0000 (03:18 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 19 Jan 2014 03:18:31 +0000 (03:18 +0000)
commit2becaaf3a15a8815f93e65f768038427051ee004
tree41045d50bc61e13cc302f4647f9bf6604c236f23
parente608d695de5c8b8de80041d9b654f42b1d7fb893
LoopVectorizer: A reduction that has multiple uses of the reduction value is not
a reduction.

Really. Under certain circumstances (the use list of an instruction has to be
set up right - hence the extra pass in the test case) we would not recognize
when a value in a potential reduction cycle was used multiple times by the
reduction cycle.

Fixes PR18526.
radar://15851149

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199570 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/multi-use-reduction-bug.ll [new file with mode: 0644]