[BOLT] Fix SCTC bug

Summary:
If conditional branch has been converted to conditional tail call,
it may be considered for SCTC optimization later since it will
appear as a tail call. We have to make sure that the tail call
we are considering is not a conditional branch.

(cherry picked from FBD5884777)
This commit is contained in:
Maksim Panchenko 2017-09-19 16:59:05 -07:00
parent b006d2a860
commit 156fc73157
1 changed files with 1 additions and 1 deletions

View File

@ -585,7 +585,7 @@ uint64_t SimplifyConditionalTailCalls::fixTailCalls(BinaryContext &BC,
continue;
auto *Instr = BB->getFirstNonPseudoInstr();
if (!MIA->isTailCall(*Instr))
if (!MIA->isTailCall(*Instr) || BC.MIA->isConditionalBranch(*Instr))
continue;
auto *CalleeSymbol = MIA->getTargetSymbol(*Instr);