summaryrefslogtreecommitdiffstats
path: root/llvm/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
commiteeac7ce76933d91b062d7afe912b25f9d7ec4171 (patch)
treec0073711515dcd9f69de160fa11eb3993133986e /llvm/lib/CodeGen/BranchFolding.cpp
parent19ac306c2ca89bac14c8534686ade6931eb7d34f (diff)
downloadbcm5719-llvm-eeac7ce76933d91b062d7afe912b25f9d7ec4171.tar.gz
bcm5719-llvm-eeac7ce76933d91b062d7afe912b25f9d7ec4171.zip
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. llvm-svn: 89121
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 8a6b0de4e3a..d344af06fd5 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/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()
OpenPOWER on IntegriCloud