@@ -601,11 +601,8 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
601601 // that rearrange the predecessors of the indirect branch.
602602
603603 bool HasIndirectbr = false ;
604- bool HasComputedGoto = false ;
605- if (!TailBB.empty ()) {
604+ if (!TailBB.empty ())
606605 HasIndirectbr = TailBB.back ().isIndirectBranch ();
607- HasComputedGoto = TailBB.back ().isComputedGoto ();
608- }
609606
610607 if (HasIndirectbr && PreRegAlloc)
611608 MaxDuplicateCount = TailDupIndirectBranchSize;
@@ -663,12 +660,7 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
663660 // Duplicating a BB which has both multiple predecessors and successors will
664661 // may cause huge amount of PHI nodes. If we want to remove this limitation,
665662 // 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 &&
672664 TailBB.succ_size () > TailDupSuccSize) {
673665 // If TailBB or any of its successors contains a phi, we may have to add a
674666 // large number of additional phis with additional incoming values.
0 commit comments