[MachineBasicBlock] Fix a typo in function copySuccessor
authorGuozhi Wei <carrot@google.com>
Tue, 15 Sep 2020 16:18:18 +0000 (09:18 -0700)
committerGuozhi Wei <carrot@google.com>
Tue, 15 Sep 2020 16:18:18 +0000 (09:18 -0700)
The condition used to decide if need to copy probability should be reversed.

Differential Revision: https://reviews.llvm.org/D87417

llvm/lib/CodeGen/MachineBasicBlock.cpp

index b260af7..42d5199 100644 (file)
@@ -828,7 +828,7 @@ void MachineBasicBlock::replaceSuccessor(MachineBasicBlock *Old,
 
 void MachineBasicBlock::copySuccessor(MachineBasicBlock *Orig,
                                       succ_iterator I) {
-  if (Orig->Probs.empty())
+  if (!Orig->Probs.empty())
     addSuccessor(*I, Orig->getSuccProbability(I));
   else
     addSuccessorWithoutProb(*I);