Remove the successor probabilities normalization in tail duplication pass.
authorCong Hou <congh@google.com>
Mon, 14 Dec 2015 19:11:54 +0000 (19:11 +0000)
committerCong Hou <congh@google.com>
Mon, 14 Dec 2015 19:11:54 +0000 (19:11 +0000)
The normalization may cause assertion failures on SystemZ and some out-of-tree
tests. The root cause is that unknown probabilities are materialized into known
ones by calling getSuccProbability(), which is then used to add another
successor to the same MBB which results in mixed known and unknown
probabilities. But currently those mixed probabilities cannot be normalized.

I will compose another patch to fix the root issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255530 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TailDuplication.cpp

index 9bd15dd6ec7287649b033fd62748b5201ec5feb2..1f5b54866ac627179045d51751a2e3417e3ddcc5 100644 (file)
@@ -751,7 +751,6 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB,
     assert(NumSuccessors <= 1);
     if (NumSuccessors == 0 || *PredBB->succ_begin() != NewTarget)
       PredBB->addSuccessor(NewTarget, Prob);
-    PredBB->normalizeSuccProbs();
 
     TDBBs.push_back(PredBB);
   }