diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-09-21 00:27:05 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-09-21 00:27:05 +0000 |
commit | 3371172a6761f7e12d0dc80b631dabfd70e0fecf (patch) | |
tree | 3af688fdd9058d022253ce0ba5ccab0475d77c8a /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | f1dfbfdde1245b1f045bf57e3090782fd37db475 (diff) | |
download | bcm5719-llvm-3371172a6761f7e12d0dc80b631dabfd70e0fecf.tar.gz bcm5719-llvm-3371172a6761f7e12d0dc80b631dabfd70e0fecf.zip |
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
llvm-svn: 191122
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 30908c8ebf3..02029e6ae06 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/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. |