OSDN Git Service

[SimplifyCFG] SimplifyBranchOnICmpChain(): don't insert a DomTree edge that already...
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 11 Jan 2021 21:18:23 +0000 (00:18 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 11 Jan 2021 23:09:46 +0000 (02:09 +0300)
BB was already always branching to EdgeBB, there is no edge to add.

Indeed, this change does not have a test coverage change.
This failure has been exposed in an existing test coverage
by a follow-up patch that switches to lazy domtreeupdater mode,
and removes domtree verification from
SimplifyCFGOpt::simplifyOnce()/SimplifyCFGOpt::run(),
IOW it does not appear feasible to add dedicated test coverage here.

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

index 747eb52..7158133 100644 (file)
@@ -4229,7 +4229,6 @@ bool SimplifyCFGOpt::SimplifyBranchOnICmpChain(BranchInst *BI,
   // We added edges from PI to the EdgeBB.  As such, if there were any
   // PHI nodes in EdgeBB, they need entries to be added corresponding to
   // the number of edges added.
-  Updates.push_back({DominatorTree::Insert, BB, EdgeBB});
   for (BasicBlock::iterator BBI = EdgeBB->begin(); isa<PHINode>(BBI); ++BBI) {
     PHINode *PN = cast<PHINode>(BBI);
     Value *InVal = PN->getIncomingValueForBlock(BB);