From 2ecd8c90b037e58f4914acfc6a4ced5a01774a05 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Sat, 21 Sep 2013 00:27:05 +0000 Subject: 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 --- lib/Transforms/Vectorize/LoopVectorize.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 30908c8..02029e6 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(it); - if (CI && !getIntrinsicIDForCall(CI, TLI) && !isa(CI)) { + if (CI) { DEBUG(dbgs() << "LV: Found a call site.\n"); - return false; + + if (!isa(it)) { + DEBUG(dbgs() << "LV: We only vectorize intrinsics.\n"); + return false; + } + + if (!getIntrinsicIDForCall(CI, TLI) && !isa(CI)) { + DEBUG(dbgs() << "LV: Found an unknown intrinsic.\n"); + return false; + } } // Check that the instruction return type is vectorizable. -- cgit v1.1