aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-11-17 18:30:09 +0000
committerBob Wilson <bob.wilson@apple.com>2009-11-17 18:30:09 +0000
commitaa60ddac394e8d79ecd9700e32b595c115585007 (patch)
treea7414886541f0e50696ebdbd975ca91a2e586a79 /lib/CodeGen/BranchFolding.cpp
parent076e085698c484354c9e131f1bd8fd001581397b (diff)
Remove a special case for tail merging that seems to be both broken and
unnecessary. It is broken because the "isIdenticalTo" check should be negated. If that is fixed, this code causes the CodeGen/X86/tail-opts.ll test to fail, in the dont_merge_oddly function. And, I confirmed that the regression is real -- the generated code is worse. As far as I can tell, that tail-opts.ll test is checking for what this code is supposed to handle and we're doing the right thing anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 8a6b0de4e3..d344af06fd 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -670,39 +670,6 @@ bool BranchFolder::TryTailMergeBlocks(MachineBasicBlock *SuccBB,
// this many instructions in common.
unsigned minCommonTailLength = TailMergeSize;
- // If there's a successor block, there are some cases which don't require
- // new branching and as such are very likely to be profitable.
- if (SuccBB) {
- if (SuccBB->pred_size() == MergePotentials.size() &&
- !MergePotentials[0].getBlock()->empty()) {
- // If all the predecessors have at least one tail instruction in common,
- // merging is very likely to be a win since it won't require an increase
- // in static branches, and it will decrease the static instruction count.
- bool AllPredsMatch = true;
- MachineBasicBlock::iterator FirstNonTerm;
- unsigned MinNumTerms = CountTerminators(MergePotentials[0].getBlock(),
- FirstNonTerm);
- if (FirstNonTerm != MergePotentials[0].getBlock()->end()) {
- for (unsigned i = 1, e = MergePotentials.size(); i != e; ++i) {
- MachineBasicBlock::iterator OtherFirstNonTerm;
- unsigned NumTerms = CountTerminators(MergePotentials[0].getBlock(),
- OtherFirstNonTerm);
- if (NumTerms < MinNumTerms)
- MinNumTerms = NumTerms;
- if (OtherFirstNonTerm == MergePotentials[i].getBlock()->end() ||
- OtherFirstNonTerm->isIdenticalTo(FirstNonTerm)) {
- AllPredsMatch = false;
- break;
- }
- }
-
- // If they all have an instruction in common, do any amount of merging.
- if (AllPredsMatch)
- minCommonTailLength = MinNumTerms + 1;
- }
- }
- }
-
DEBUG(errs() << "\nTryTailMergeBlocks: ";
for (unsigned i = 0, e = MergePotentials.size(); i != e; ++i)
errs() << "BB#" << MergePotentials[i].getBlock()->getNumber()