mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
--- Merging r128212 into '.':
U lib/Transforms/Scalar/CodeGenPrepare.cpp --- Merging r128217 into '.': G lib/Transforms/Scalar/CodeGenPrepare.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_29@128223 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5bc870c8c3
commit
76c60c3241
@ -602,7 +602,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,10 +628,12 @@ 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->getType()->isVoidTy() && TLI->mayBeEmittedAsTailCall(CI))
|
if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI))
|
||||||
TailCalls.push_back(CI);
|
TailCalls.push_back(CI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user