@@ -601,11 +601,8 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
601
601
// that rearrange the predecessors of the indirect branch.
602
602
603
603
bool HasIndirectbr = false ;
604
- bool HasComputedGoto = false ;
605
- if (!TailBB.empty ()) {
604
+ if (!TailBB.empty ())
606
605
HasIndirectbr = TailBB.back ().isIndirectBranch ();
607
- HasComputedGoto = TailBB.back ().isComputedGoto ();
608
- }
609
606
610
607
if (HasIndirectbr && PreRegAlloc)
611
608
MaxDuplicateCount = TailDupIndirectBranchSize;
@@ -663,12 +660,7 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
663
660
// Duplicating a BB which has both multiple predecessors and successors will
664
661
// may cause huge amount of PHI nodes. If we want to remove this limitation,
665
662
// we have to address https://github.com/llvm/llvm-project/issues/78578.
666
- // NB. This basically unfactors computed gotos that were factored early on in
667
- // the compilation process to speed up edge based data flow. If we do not
668
- // unfactor them again, it can seriously pessimize code with many computed
669
- // jumps in the source code, such as interpreters. Therefore we do not
670
- // restrict the computed gotos.
671
- if (!HasComputedGoto && TailBB.pred_size () > TailDupPredSize &&
663
+ if (TailBB.pred_size () > TailDupPredSize &&
672
664
TailBB.succ_size () > TailDupSuccSize) {
673
665
// If TailBB or any of its successors contains a phi, we may have to add a
674
666
// large number of additional phis with additional incoming values.
0 commit comments