diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-04-09 14:20:47 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-04-09 14:20:47 +0000 |
commit | fd0bf5d6e5c258367811befde2d13111dc4ccf40 (patch) | |
tree | 0b87288eab70b96884f915047a7eb0f229779754 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 110f3cc45a141a7c69c81099b44f4f99477bd1ee (diff) | |
download | bcm5719-llvm-fd0bf5d6e5c258367811befde2d13111dc4ccf40.tar.gz bcm5719-llvm-fd0bf5d6e5c258367811befde2d13111dc4ccf40.zip |
SLPVectorizer: Only vectorize intrinsics whose operands are widened equally
The vectorizer only knows how to vectorize intrinics by widening all operands by
the same factor.
Patch by Tyler Nowicki!
llvm-svn: 205855
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index ca55b4d6c90..6a78d756ccc 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -41,6 +41,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/Utils/VectorUtils.h" #include <algorithm> #include <map> @@ -949,7 +950,9 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth) { case Instruction::Call: { // Check if the calls are all to the same vectorizable intrinsic. IntrinsicInst *II = dyn_cast<IntrinsicInst>(VL[0]); - if (II==NULL) { + Intrinsic::ID ID = II ? II->getIntrinsicID() : Intrinsic::not_intrinsic; + + if (!isTriviallyVectorizable(ID)) { newTreeEntry(VL, false); DEBUG(dbgs() << "SLP: Non-vectorizable call.\n"); return; |