Skip to content

Commit

Permalink
Revert "[TailDuplicator] Add maximum predecessors and successors to c…
Browse files Browse the repository at this point in the history
…onsider tail duplicating blocks (#78582)"

This reverts commit 86a7828.

Now, we only consider computed GOTOs.
  • Loading branch information
DianQK committed Nov 20, 2024
1 parent 927b95e commit 5e4c0f4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 777 deletions.
20 changes: 0 additions & 20 deletions llvm/lib/CodeGen/TailDuplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ static cl::opt<unsigned> TailDupIndirectBranchSize(
"end with indirect branches."), cl::init(20),
cl::Hidden);

static cl::opt<unsigned>
TailDupPredSize("tail-dup-pred-size",
cl::desc("Maximum predecessors (maximum successors at the "
"same time) to consider tail duplicating blocks."),
cl::init(16), cl::Hidden);

static cl::opt<unsigned>
TailDupSuccSize("tail-dup-succ-size",
cl::desc("Maximum successors (maximum predecessors at the "
"same time) to consider tail duplicating blocks."),
cl::init(16), cl::Hidden);

static cl::opt<bool>
TailDupVerify("tail-dup-verify",
cl::desc("Verify sanity of PHI instructions during taildup"),
Expand Down Expand Up @@ -573,14 +561,6 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
if (TailBB.isSuccessor(&TailBB))
return false;

// Duplicating a BB which has both multiple predecessors and successors will
// result in a complex CFG and also may cause huge amount of PHI nodes. If we
// want to remove this limitation, we have to address
// https://github.com/llvm/llvm-project/issues/78578.
if (TailBB.pred_size() > TailDupPredSize &&
TailBB.succ_size() > TailDupSuccSize)
return false;

// Set the limit on the cost to duplicate. When optimizing for size,
// duplicate only one, because one branch instruction can be eliminated to
// compensate for the duplication.
Expand Down
Loading

0 comments on commit 5e4c0f4

Please sign in to comment.