summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-09-21 00:27:05 +0000
committerNadav Rotem <nrotem@apple.com>2013-09-21 00:27:05 +0000
commit2ecd8c90b037e58f4914acfc6a4ced5a01774a05 (patch)
tree626833dfa50687c04834178fa4da3948a7c62375 /lib/Transforms/Vectorize/LoopVectorize.cpp
parent74d3482f76d1f8a20cedfc6701e017e7fd337cf9 (diff)
downloadllvm-2ecd8c90b037e58f4914acfc6a4ced5a01774a05.tar.gz
llvm-2ecd8c90b037e58f4914acfc6a4ced5a01774a05.tar.bz2
llvm-2ecd8c90b037e58f4914acfc6a4ced5a01774a05.tar.xz
LoopVectorizer: Only allow vectorization of intrinsics. We can't know for sure that the functions 'abs' or 'round' are the functions from libm.
rdar://15012650 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 30908c8ebf..02029e6ae0 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2925,9 +2925,18 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
// We still don't handle functions. However, we can ignore dbg intrinsic
// calls and we do handle certain intrinsic and libm functions.
CallInst *CI = dyn_cast<CallInst>(it);
- if (CI && !getIntrinsicIDForCall(CI, TLI) && !isa<DbgInfoIntrinsic>(CI)) {
+ if (CI) {
DEBUG(dbgs() << "LV: Found a call site.\n");
- return false;
+
+ if (!isa<IntrinsicInst>(it)) {
+ DEBUG(dbgs() << "LV: We only vectorize intrinsics.\n");
+ return false;
+ }
+
+ if (!getIntrinsicIDForCall(CI, TLI) && !isa<DbgInfoIntrinsic>(CI)) {
+ DEBUG(dbgs() << "LV: Found an unknown intrinsic.\n");
+ return false;
+ }
}
// Check that the instruction return type is vectorizable.