IfConversion: Don't count branches in # of duplicates.

If the entire blocks match, we would count the branch instructions
toward the number of duplicated instructions. This doesn't match what we
do elsewhere, and was causing a bug.

llvm-svn: 280448
This commit is contained in:
Kyle Butt 2016-09-02 01:20:06 +00:00
parent c906ff63da
commit 93e94e8a12
1 changed files with 3 additions and 1 deletions

View File

@ -671,7 +671,9 @@ bool IfConverter::CountDuplicatedInstructions(
std::vector<MachineOperand> PredDefs;
if (TII->DefinesPredicate(*TIB, PredDefs))
return false;
++Dups1;
// If we get all the way to the branch instructions, don't count them.
if (!TIB->isBranch())
++Dups1;
++TIB;
++FIB;
}