aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-12-02 21:49:08 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-06-04 11:59:04 +0000
commit574b7079b96703a748f89ef5adb7dc3e26b8f7fc (patch)
tree195000196b1e0cc13dea43258fa240e006f48184 /contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
parent1f6fd64fe9c996b4795ee4a6c66b8f9216747560 (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp b/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
index 943bd18c6c8b..54fc6ee45d00 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
@@ -70,12 +70,6 @@ static cl::opt<unsigned> TailDupIndirectBranchSize(
"end with indirect branches."), cl::init(20),
cl::Hidden);
-static cl::opt<unsigned> TailDupJmpTableLoopSize(
- "tail-dup-jmptable-loop-size",
- cl::desc("Maximum loop latches to consider tail duplication that are "
- "successors of loop header."),
- cl::init(128), cl::Hidden);
-
static cl::opt<bool>
TailDupVerify("tail-dup-verify",
cl::desc("Verify sanity of PHI instructions during taildup"),
@@ -569,29 +563,6 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
if (TailBB.isSuccessor(&TailBB))
return false;
- // When doing tail-duplication with jumptable loops like:
- // 1 -> 2 <-> 3 |
- // \ <-> 4 |
- // \ <-> 5 |
- // \ <-> ... |
- // \---> rest |
- // quadratic number of edges and much more loops are added to CFG. This
- // may cause compile time regression when jumptable is quiet large.
- // So set the limit on jumptable cases.
- auto isLargeJumpTableLoop = [](const MachineBasicBlock &TailBB) {
- const SmallPtrSet<const MachineBasicBlock *, 8> Preds(TailBB.pred_begin(),
- TailBB.pred_end());
- // Check the basic block has large number of successors, all of them only
- // have one successor which is the basic block itself.
- return llvm::count_if(
- TailBB.successors(), [&](const MachineBasicBlock *SuccBB) {
- return Preds.count(SuccBB) && SuccBB->succ_size() == 1;
- }) > TailDupJmpTableLoopSize;
- };
-
- if (isLargeJumpTableLoop(TailBB))
- 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.