forked from OSchip/llvm-project
Debug intrinsics must be skipped at the beginning and ends of blocks, lest they
affect the generated code. llvm-svn: 128217
This commit is contained in:
parent
b03bd5983d
commit
74157ab3e5
|
@ -617,7 +617,9 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(ReturnInst *RI) {
|
||||||
if (&*BI != RI)
|
if (&*BI != RI)
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (&*BB->begin() != RI)
|
BasicBlock::iterator BI = BB->begin();
|
||||||
|
while (isa<DbgInfoIntrinsic>(BI)) ++BI;
|
||||||
|
if (&*BI != RI)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,8 +643,10 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(ReturnInst *RI) {
|
||||||
BasicBlock::InstListType &InstList = (*PI)->getInstList();
|
BasicBlock::InstListType &InstList = (*PI)->getInstList();
|
||||||
BasicBlock::InstListType::reverse_iterator RI = InstList.rbegin();
|
BasicBlock::InstListType::reverse_iterator RI = InstList.rbegin();
|
||||||
BasicBlock::InstListType::reverse_iterator RE = InstList.rend();
|
BasicBlock::InstListType::reverse_iterator RE = InstList.rend();
|
||||||
if (++RI == RE)
|
do { ++RI; } while (RI != RE && isa<DbgInfoIntrinsic>(&*RI));
|
||||||
|
if (RI == RE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CallInst *CI = dyn_cast<CallInst>(&*RI);
|
CallInst *CI = dyn_cast<CallInst>(&*RI);
|
||||||
if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI))
|
if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI))
|
||||||
TailCalls.push_back(CI);
|
TailCalls.push_back(CI);
|
||||||
|
|
Loading…
Reference in New Issue