[llvm] 243ffd0 - [MachineBasicBlock] Fix a typo in function copySuccessor

Guozhi Wei via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 09:19:15 PDT 2020


Author: Guozhi Wei
Date: 2020-09-15T09:18:18-07:00
New Revision: 243ffd0cade71ddca9b0dffec1c8e9084b0f7745

URL: https://github.com/llvm/llvm-project/commit/243ffd0cade71ddca9b0dffec1c8e9084b0f7745
DIFF: https://github.com/llvm/llvm-project/commit/243ffd0cade71ddca9b0dffec1c8e9084b0f7745.diff

LOG: [MachineBasicBlock] Fix a typo in function copySuccessor

The condition used to decide if need to copy probability should be reversed.

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineBasicBlock.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index b260af72043b..42d519970c4d 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -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);


        


More information about the llvm-commits mailing list