================
@@ -2156,9 +2164,13 @@ bool
SimplifyCFGOpt::hoistSuccIdenticalTerminatorToSwitchOrIf(
Updates.push_back({DominatorTree::Insert, TIParent, Succ});
}
- if (DTU)
- for (BasicBlock *Succ : successors(TI))
+ if (DTU) {
+ // TI might be a switch with multi-cases destination, so we need to care
for
+ // the duplication of successors.
+ SmallPtrSet<BasicBlock *, 4> UniqSuccs(llvm::from_range, successors(TI));
----------------
nikic wrote:
Why can't we use the existing UniqSuccessors here and need to compute it again?
https://github.com/llvm/llvm-project/pull/165700
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits