diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-03-09 15:56:34 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-03-09 15:56:34 +0000 |
commit | 56ee544a3af2b019329f06422c00e8a3645b895c (patch) | |
tree | 0efec4dc4ae78b20245437f37c4698ef75b98dac /lib | |
parent | 576f62c1ead0c099aacf2bc08552a1348d57c23f (diff) | |
download | external_llvm-56ee544a3af2b019329f06422c00e8a3645b895c.zip external_llvm-56ee544a3af2b019329f06422c00e8a3645b895c.tar.gz external_llvm-56ee544a3af2b019329f06422c00e8a3645b895c.tar.bz2 |
LoopVectorizer: Ignore dbg.value instructions
We want vectorization to happen at -g. Ignore calls to the dbg.value intrinsic
and don't transfer them to the vectorized code.
radar://13378964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-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 11f4b02..e1f2932 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2088,6 +2088,10 @@ InnerLoopVectorizer::vectorizeBlockInLoop(LoopVectorizationLegality *Legal, } case Instruction::Call: { + // Ignore dbg.value instructions. + if (isa<DbgValueInst>(it)) + break; + Module *M = BB->getParent()->getParent(); CallInst *CI = cast<CallInst>(it); Intrinsic::ID ID = getIntrinsicIDForCall(CI, TLI); @@ -2324,9 +2328,10 @@ bool LoopVectorizationLegality::canVectorizeInstrs() { return false; }// end of PHI handling - // We still don't handle functions. + // We still don't handle functions. However, we can ignore dbg.value + // calls and we do handle certain intrinsic and libm functions. CallInst *CI = dyn_cast<CallInst>(it); - if (CI && !getIntrinsicIDForCall(CI, TLI)) { + if (CI && !getIntrinsicIDForCall(CI, TLI) && !isa<DbgValueInst>(CI)) { DEBUG(dbgs() << "LV: Found a call site.\n"); return false; } @@ -3263,6 +3268,10 @@ unsigned LoopVectorizationCostModel::expectedCost(unsigned VF) { // For each instruction in the old loop. for (BasicBlock::iterator it = BB->begin(), e = BB->end(); it != e; ++it) { + // Skip dbg.value instructions. + if (isa<DbgValueInst>(it)) + continue; + unsigned C = getInstructionCost(it, VF); Cost += C; DEBUG(dbgs() << "LV: Found an estimated cost of "<< C <<" for VF " << |