summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-01-29 02:43:04 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-01-29 02:43:04 +0000
commit65b8ccf6ac2c9c639ff91a31c7962c7f92deb266 (patch)
tree4461d784c4c7ce1ac4d3680a8006afbf72fd5fff /llvm/lib/CodeGen
parent2a5fdd4729f922969f694f30096ea46880303a21 (diff)
downloadbcm5719-llvm-65b8ccf6ac2c9c639ff91a31c7962c7f92deb266.tar.gz
bcm5719-llvm-65b8ccf6ac2c9c639ff91a31c7962c7f92deb266.zip
Revert r124518. It broke Linux self-host.
llvm-svn: 124522
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TailDuplication.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp
index 15aed3436c7..ce4b1be8541 100644
--- a/llvm/lib/CodeGen/TailDuplication.cpp
+++ b/llvm/lib/CodeGen/TailDuplication.cpp
@@ -465,12 +465,9 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
MaxDuplicateCount = TailDuplicateSize;
if (PreRegAlloc) {
- if (TailBB->empty())
- return false;
- const TargetInstrDesc &TID = TailBB->back().getDesc();
- // Pre-regalloc tail duplication hurts compile time and doesn't help
- // much except for indirect branches and returns.
- if (!TID.isIndirectBranch() && !TID.isReturn())
+ // Pre-regalloc tail duplication hurts compile time and doesn't help
+ // much except for indirect branches.
+ if (TailBB->empty() || !TailBB->back().getDesc().isIndirectBranch())
return false;
// If the target has hardware branch prediction that can handle indirect
// branches, duplicating them can often make them predictable when there
@@ -505,7 +502,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
}
// Heuristically, don't tail-duplicate calls if it would expand code size,
// as it's less likely to be worth the extra cost.
- if (InstrCount > 1 && (PreRegAlloc && HasCall))
+ if (InstrCount > 1 && HasCall)
return false;
DEBUG(dbgs() << "\n*** Tail-duplicating BB#" << TailBB->getNumber() << '\n');
OpenPOWER on IntegriCloud