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 | 4090b61ac3a0d000e0c0c748ff3048d8fefe2e0d (patch) | |
| tree | 460145920a2e410581c00bcea250116786627204 /llvm/lib | |
| parent | 36f89ccc49b37c9eeb59dea853a6fc2df3a8dcbf (diff) | |
| download | bcm5719-llvm-4090b61ac3a0d000e0c0c748ff3048d8fefe2e0d.tar.gz bcm5719-llvm-4090b61ac3a0d000e0c0c748ff3048d8fefe2e0d.zip | |
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
llvm-svn: 176768
Diffstat (limited to 'llvm/lib')
| -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 11f4b022045..e1f29322318 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/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 " << |

