mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Revert r124462. There are a few big regressions that I need to fix first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124478 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user