diff options
author | dim <dim@FreeBSD.org> | 2014-05-11 18:24:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-05-11 18:24:26 +0000 |
commit | 87ba4fbed530c9d0dff7505d121035f5ed09c9f3 (patch) | |
tree | 9f9245264c66971905eab3af40b7fc82e38fc2ad /lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | bbe9ac81c3fe3a3ea47d81758276b4432d28786a (diff) | |
download | FreeBSD-src-87ba4fbed530c9d0dff7505d121035f5ed09c9f3.zip FreeBSD-src-87ba4fbed530c9d0dff7505d121035f5ed09c9f3.tar.gz |
Vendor import of llvm RELEASE_34/dot1-final tag r208032 (effectively, 3.4.1 release):
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/dot1-final@208032
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 5e75871..f9f6b18 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -4191,13 +4191,22 @@ bool LoopVectorizationLegality::AddReductionVar(PHINode *Phi, continue; } - // Process instructions only once (termination). + // Process instructions only once (termination). Each reduction cycle + // value must only be used once, except by phi nodes and min/max + // reductions which are represented as a cmp followed by a select. + ReductionInstDesc IgnoredVal(false, 0); if (VisitedInsts.insert(Usr)) { if (isa<PHINode>(Usr)) PHIs.push_back(Usr); else NonPHIs.push_back(Usr); - } + } else if (!isa<PHINode>(Usr) && + ((!isa<FCmpInst>(Usr) && + !isa<ICmpInst>(Usr) && + !isa<SelectInst>(Usr)) || + !isMinMaxSelectCmpPattern(Usr, IgnoredVal).IsReduction)) + return false; + // Remember that we completed the cycle. if (Usr == Phi) FoundStartPHI = true; |