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
This commit is contained in:
Arnold Schwaighofer
2013-03-09 15:56:34 +00:00
parent 576f62c1ea
commit 56ee544a3a
2 changed files with 81 additions and 2 deletions

View File

@ -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 " <<