forked from OSchip/llvm-project
[BOLT] Fix SCTC issue with hot-cold split
Summary: SCTC was deleting an unconditional branch to a block in the cold area because it was the next block in the layout vector. Fix the condition to only delete such branches when source and target are in the same allocation area (either both hot or both cold). (cherry picked from FBD5570300)
This commit is contained in:
parent
e4290d083f
commit
b81ff8a8fc
|
@ -679,7 +679,8 @@ uint64_t SimplifyConditionalTailCalls::fixTailCalls(BinaryContext &BC,
|
|||
PredBB->analyzeBranch(TBB, FBB, CondBranch, UncondBranch);
|
||||
|
||||
// Only add a new branch if the target is not the fall-through.
|
||||
if (BF.getBasicBlockAfter(BB, false) != CondSucc || isValid(BB)) {
|
||||
if (BF.getBasicBlockAfter(BB) != CondSucc || isValid(BB) ||
|
||||
PredBB->isCold() != CondSucc->isCold()) {
|
||||
if (UncondBranch) {
|
||||
MIA->replaceBranchTarget(*UncondBranch,
|
||||
CondSucc->getLabel(),
|
||||
|
|
Loading…
Reference in New Issue