[SimplifyCFG] SwitchToLookupTable(): don't insert a DomTree edge that already exists

SI is the terminator of BB, so the edge we are adding obviously already existed.

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.
This commit is contained in:
Roman Lebedev 2021-01-11 16:01:57 +03:00
parent 278a3ea1b2
commit c22bc5f1f8
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 0 additions and 1 deletions

View File

@ -5973,7 +5973,6 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder,
RangeCheckBranch =
Builder.CreateCondBr(Cmp, LookupBB, SI->getDefaultDest());
Updates.push_back({DominatorTree::Insert, BB, LookupBB});
Updates.push_back({DominatorTree::Insert, BB, SI->getDefaultDest()});
}
// Populate the BB that does the lookups.