affect the generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128217
91177308-0d34-0410-b5e6-
96231b3b80d8
if (&*BI != RI)
return false;
} else {
- if (&*BB->begin() != RI)
+ BasicBlock::iterator BI = BB->begin();
+ while (isa<DbgInfoIntrinsic>(BI)) ++BI;
+ if (&*BI != RI)
return false;
}
BasicBlock::InstListType &InstList = (*PI)->getInstList();
BasicBlock::InstListType::reverse_iterator RI = InstList.rbegin();
BasicBlock::InstListType::reverse_iterator RE = InstList.rend();
- if (++RI == RE)
+ do { ++RI; } while (RI != RE && isa<DbgInfoIntrinsic>(&*RI));
+ if (RI == RE)
continue;
+
CallInst *CI = dyn_cast<CallInst>(&*RI);
if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI))
TailCalls.push_back(CI);