From e1b9536d546b78f8cffc7efbb2ff75d7e15f9749 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 17 Jul 2004 21:51:25 +0000 Subject: [PATCH] It looks like physref->virtreg joining is working fine. Enable it by default but make virtreg->virtreg joining stay off by default git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14916 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 29 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 12983a52e20..e0ea6d95be1 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -57,9 +57,13 @@ namespace { ("liveintervals", "Number of loads/stores folded into instructions"); cl::opt - join("join-liveintervals", - cl::desc("Join compatible live intervals"), - cl::init(false)); + EnableJoining("join-liveintervals", + cl::desc("Join compatible live intervals"), + cl::init(true)); + cl::opt + EnableVirtVirtJoining("join-liveintervals-virtvirtjoining", + cl::desc("Join live intervals for virtreg pairs (buggy)"), + cl::init(false)); }; void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const @@ -115,7 +119,7 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { numIntervals += intervals_.size(); // join intervals if requested - if (join) joinIntervals(); + if (EnableJoining) joinIntervals(); numIntervalsAfter += intervals_.size(); @@ -494,15 +498,21 @@ void LiveIntervals::joinIntervals() continue; Reg2IntervalMap::iterator r2iA = r2iMap_.find(regA); - assert(r2iA != r2iMap_.end()); + assert(r2iA != r2iMap_.end() && + "Found unknown vreg in 'isMoveInstr' instruction"); Reg2IntervalMap::iterator r2iB = r2iMap_.find(regB); - assert(r2iB != r2iMap_.end()); + assert(r2iB != r2iMap_.end() && + "Found unknown vreg in 'isMoveInstr' instruction"); Intervals::iterator intA = r2iA->second; Intervals::iterator intB = r2iB->second; // both A and B are virtual registers - if (MRegisterInfo::isVirtualRegister(intA->reg) && + + // FIXME: coallescing two virtual registers together is + // apparently broken. + if (EnableVirtVirtJoining && + MRegisterInfo::isVirtualRegister(intA->reg) && MRegisterInfo::isVirtualRegister(intB->reg)) { const TargetRegisterClass *rcA, *rcB; @@ -519,9 +529,8 @@ void LiveIntervals::joinIntervals() r2rMap_.insert(std::make_pair(intB->reg, intA->reg)); intervals_.erase(intB); } - } - else if (MRegisterInfo::isPhysicalRegister(intA->reg) ^ - MRegisterInfo::isPhysicalRegister(intB->reg)) { + } else if (MRegisterInfo::isPhysicalRegister(intA->reg) ^ + MRegisterInfo::isPhysicalRegister(intB->reg)) { if (MRegisterInfo::isPhysicalRegister(intB->reg)) { std::swap(regA, regB); std::swap(intA, intB);