2003-11-20 03:32:25 +00:00
|
|
|
//===-- LiveIntervals.cpp - Live Interval Analysis ------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the LiveInterval analysis pass which is used
|
|
|
|
// by the Linear Scan Register allocator. This pass linearizes the
|
|
|
|
// basic blocks of the function in DFS order and uses the
|
|
|
|
// LiveVariables pass to conservatively compute live intervals for
|
|
|
|
// each virtual and physical register.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#define DEBUG_TYPE "liveintervals"
|
|
|
|
#include "llvm/CodeGen/LiveIntervals.h"
|
|
|
|
#include "llvm/Function.h"
|
2003-12-21 20:19:10 +00:00
|
|
|
#include "llvm/Analysis/LoopInfo.h"
|
2003-11-20 03:32:25 +00:00
|
|
|
#include "llvm/CodeGen/LiveVariables.h"
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
|
|
|
#include "llvm/CodeGen/MachineInstr.h"
|
|
|
|
#include "llvm/CodeGen/Passes.h"
|
|
|
|
#include "llvm/CodeGen/SSARegMap.h"
|
|
|
|
#include "llvm/Target/MRegisterInfo.h"
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetRegInfo.h"
|
|
|
|
#include "llvm/Support/CFG.h"
|
|
|
|
#include "Support/Debug.h"
|
|
|
|
#include "Support/DepthFirstIterator.h"
|
|
|
|
#include "Support/Statistic.h"
|
2003-12-21 20:19:10 +00:00
|
|
|
#include <cmath>
|
2003-11-20 03:32:25 +00:00
|
|
|
#include <iostream>
|
2003-12-21 20:19:10 +00:00
|
|
|
#include <limits>
|
2003-11-20 03:32:25 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
RegisterAnalysis<LiveIntervals> X("liveintervals",
|
|
|
|
"Live Interval Analysis");
|
|
|
|
|
|
|
|
Statistic<> numIntervals("liveintervals", "Number of intervals");
|
|
|
|
};
|
|
|
|
|
|
|
|
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const
|
|
|
|
{
|
2003-12-15 04:55:38 +00:00
|
|
|
AU.addPreserved<LiveVariables>();
|
2003-11-20 03:32:25 +00:00
|
|
|
AU.addRequired<LiveVariables>();
|
2003-12-15 04:55:38 +00:00
|
|
|
AU.addPreservedID(PHIEliminationID);
|
2003-11-20 03:32:25 +00:00
|
|
|
AU.addRequiredID(PHIEliminationID);
|
2003-12-18 22:40:24 +00:00
|
|
|
AU.addRequiredID(TwoAddressInstructionPassID);
|
2003-12-21 20:19:10 +00:00
|
|
|
AU.addRequired<LoopInfo>();
|
2003-11-20 03:32:25 +00:00
|
|
|
MachineFunctionPass::getAnalysisUsage(AU);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// runOnMachineFunction - Register allocate the whole function
|
|
|
|
///
|
|
|
|
bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
|
|
|
DEBUG(std::cerr << "Machine Function\n");
|
|
|
|
mf_ = &fn;
|
|
|
|
tm_ = &fn.getTarget();
|
|
|
|
mri_ = tm_->getRegisterInfo();
|
|
|
|
lv_ = &getAnalysis<LiveVariables>();
|
|
|
|
allocatableRegisters_.clear();
|
|
|
|
mbbi2mbbMap_.clear();
|
|
|
|
mi2iMap_.clear();
|
|
|
|
r2iMap_.clear();
|
|
|
|
r2iMap_.clear();
|
|
|
|
intervals_.clear();
|
|
|
|
|
|
|
|
// mark allocatable registers
|
|
|
|
allocatableRegisters_.resize(MRegisterInfo::FirstVirtualRegister);
|
|
|
|
// Loop over all of the register classes...
|
|
|
|
for (MRegisterInfo::regclass_iterator
|
|
|
|
rci = mri_->regclass_begin(), rce = mri_->regclass_end();
|
|
|
|
rci != rce; ++rci) {
|
|
|
|
// Loop over all of the allocatable registers in the function...
|
|
|
|
for (TargetRegisterClass::iterator
|
|
|
|
i = (*rci)->allocation_order_begin(*mf_),
|
|
|
|
e = (*rci)->allocation_order_end(*mf_); i != e; ++i) {
|
|
|
|
allocatableRegisters_[*i] = true; // The reg is allocatable!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// number MachineInstrs
|
|
|
|
unsigned miIndex = 0;
|
|
|
|
for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end();
|
|
|
|
mbb != mbbEnd; ++mbb) {
|
|
|
|
const std::pair<MachineBasicBlock*, unsigned>& entry =
|
|
|
|
lv_->getMachineBasicBlockInfo(&*mbb);
|
|
|
|
bool inserted = mbbi2mbbMap_.insert(std::make_pair(entry.second,
|
|
|
|
entry.first)).second;
|
|
|
|
assert(inserted && "multiple index -> MachineBasicBlock");
|
|
|
|
|
|
|
|
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
|
|
|
|
mi != miEnd; ++mi) {
|
|
|
|
inserted = mi2iMap_.insert(std::make_pair(*mi, miIndex)).second;
|
|
|
|
assert(inserted && "multiple MachineInstr -> index mappings");
|
|
|
|
++miIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
computeIntervals();
|
|
|
|
|
2003-12-24 15:44:53 +00:00
|
|
|
// compute spill weights
|
|
|
|
const LoopInfo& loopInfo = getAnalysis<LoopInfo>();
|
2003-12-28 17:58:18 +00:00
|
|
|
const TargetInstrInfo& tii = tm_->getInstrInfo();
|
2003-12-24 15:44:53 +00:00
|
|
|
|
|
|
|
for (MbbIndex2MbbMap::iterator
|
|
|
|
it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
|
|
|
|
it != itEnd; ++it) {
|
|
|
|
MachineBasicBlock* mbb = it->second;
|
|
|
|
|
|
|
|
unsigned loopDepth = loopInfo.getLoopDepth(mbb->getBasicBlock());
|
|
|
|
|
|
|
|
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
|
|
|
|
mi != miEnd; ++mi) {
|
|
|
|
MachineInstr* instr = *mi;
|
|
|
|
for (int i = instr->getNumOperands() - 1; i >= 0; --i) {
|
|
|
|
MachineOperand& mop = instr->getOperand(i);
|
|
|
|
|
|
|
|
if (!mop.isVirtualRegister())
|
|
|
|
continue;
|
|
|
|
|
|
|
|
unsigned reg = mop.getAllocatedRegNum();
|
|
|
|
Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
|
|
|
|
assert(r2iit != r2iMap_.end());
|
|
|
|
intervals_[r2iit->second].weight += pow(10.0F, loopDepth);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-20 03:32:25 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::printRegName(unsigned reg) const
|
|
|
|
{
|
|
|
|
if (reg < MRegisterInfo::FirstVirtualRegister)
|
|
|
|
std::cerr << mri_->getName(reg);
|
|
|
|
else
|
|
|
|
std::cerr << '%' << reg;
|
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb,
|
|
|
|
MachineBasicBlock::iterator mi,
|
|
|
|
unsigned reg)
|
|
|
|
{
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << "\t\tregister: ";printRegName(reg); std::cerr << '\n');
|
2003-11-20 03:32:25 +00:00
|
|
|
|
|
|
|
unsigned instrIndex = getInstructionIndex(*mi);
|
|
|
|
|
|
|
|
LiveVariables::VarInfo& vi = lv_->getVarInfo(reg);
|
|
|
|
|
2003-12-18 08:48:48 +00:00
|
|
|
Interval* interval = 0;
|
2003-11-20 03:32:25 +00:00
|
|
|
Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
|
2003-12-18 08:48:48 +00:00
|
|
|
if (r2iit == r2iMap_.end()) {
|
2003-11-20 03:32:25 +00:00
|
|
|
// add new interval
|
|
|
|
intervals_.push_back(Interval(reg));
|
|
|
|
// update interval index for this register
|
|
|
|
r2iMap_[reg] = intervals_.size() - 1;
|
2003-12-18 08:48:48 +00:00
|
|
|
interval = &intervals_.back();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
interval = &intervals_[r2iit->second];
|
|
|
|
}
|
2003-11-20 03:32:25 +00:00
|
|
|
|
2003-12-18 08:48:48 +00:00
|
|
|
for (MbbIndex2MbbMap::iterator
|
|
|
|
it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
|
|
|
|
it != itEnd; ++it) {
|
|
|
|
unsigned liveBlockIndex = it->first;
|
|
|
|
MachineBasicBlock* liveBlock = it->second;
|
|
|
|
if (liveBlockIndex < vi.AliveBlocks.size() &&
|
2003-12-22 13:54:29 +00:00
|
|
|
vi.AliveBlocks[liveBlockIndex] &&
|
|
|
|
!liveBlock->empty()) {
|
2003-12-18 08:48:48 +00:00
|
|
|
unsigned start = getInstructionIndex(liveBlock->front());
|
|
|
|
unsigned end = getInstructionIndex(liveBlock->back()) + 1;
|
|
|
|
interval->addRange(start, end);
|
2003-11-20 03:32:25 +00:00
|
|
|
}
|
2003-12-18 08:48:48 +00:00
|
|
|
}
|
2003-11-20 03:32:25 +00:00
|
|
|
|
2003-12-18 08:48:48 +00:00
|
|
|
bool killedInDefiningBasicBlock = false;
|
|
|
|
for (int i = 0, e = vi.Kills.size(); i != e; ++i) {
|
|
|
|
MachineBasicBlock* killerBlock = vi.Kills[i].first;
|
|
|
|
MachineInstr* killerInstr = vi.Kills[i].second;
|
|
|
|
unsigned start = (mbb == killerBlock ?
|
|
|
|
instrIndex :
|
|
|
|
getInstructionIndex(killerBlock->front()));
|
|
|
|
unsigned end = getInstructionIndex(killerInstr) + 1;
|
2003-12-18 08:53:43 +00:00
|
|
|
if (start < end) {
|
|
|
|
killedInDefiningBasicBlock |= mbb == killerBlock;
|
|
|
|
interval->addRange(start, end);
|
|
|
|
}
|
2003-12-18 08:48:48 +00:00
|
|
|
}
|
2003-11-20 03:32:25 +00:00
|
|
|
|
2003-12-18 08:48:48 +00:00
|
|
|
if (!killedInDefiningBasicBlock) {
|
|
|
|
unsigned end = getInstructionIndex(mbb->back()) + 1;
|
|
|
|
interval->addRange(instrIndex, end);
|
2003-11-20 03:32:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
|
|
|
|
MachineBasicBlock::iterator mi,
|
|
|
|
unsigned reg)
|
|
|
|
{
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << "\t\tregister: ";printRegName(reg); std::cerr << '\n');
|
2003-12-13 11:11:02 +00:00
|
|
|
if (!lv_->getAllocatablePhysicalRegisters()[reg]) {
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << "\t\t\tnon allocatable register: ignoring\n");
|
2003-12-13 11:11:02 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-11-20 03:32:25 +00:00
|
|
|
|
|
|
|
unsigned start = getInstructionIndex(*mi);
|
|
|
|
unsigned end = start;
|
|
|
|
|
|
|
|
for (MachineBasicBlock::iterator e = mbb->end(); mi != e; ++mi) {
|
|
|
|
for (LiveVariables::killed_iterator
|
|
|
|
ki = lv_->dead_begin(*mi),
|
|
|
|
ke = lv_->dead_end(*mi);
|
|
|
|
ki != ke; ++ki) {
|
|
|
|
if (reg == ki->second) {
|
|
|
|
end = getInstructionIndex(ki->first) + 1;
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (LiveVariables::killed_iterator
|
|
|
|
ki = lv_->killed_begin(*mi),
|
|
|
|
ke = lv_->killed_end(*mi);
|
|
|
|
ki != ke; ++ki) {
|
|
|
|
if (reg == ki->second) {
|
|
|
|
end = getInstructionIndex(ki->first) + 1;
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit:
|
|
|
|
assert(start < end && "did not find end of interval?");
|
|
|
|
|
|
|
|
Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
|
|
|
|
if (r2iit != r2iMap_.end()) {
|
|
|
|
unsigned ii = r2iit->second;
|
|
|
|
Interval& interval = intervals_[ii];
|
|
|
|
interval.addRange(start, end);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
intervals_.push_back(Interval(reg));
|
|
|
|
Interval& interval = intervals_.back();
|
|
|
|
// update interval index for this register
|
|
|
|
r2iMap_[reg] = intervals_.size() - 1;
|
|
|
|
interval.addRange(start, end);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::handleRegisterDef(MachineBasicBlock* mbb,
|
|
|
|
MachineBasicBlock::iterator mi,
|
|
|
|
unsigned reg)
|
|
|
|
{
|
|
|
|
if (reg < MRegisterInfo::FirstVirtualRegister) {
|
|
|
|
if (allocatableRegisters_[reg]) {
|
|
|
|
handlePhysicalRegisterDef(mbb, mi, reg);
|
2004-01-13 06:24:30 +00:00
|
|
|
for (const unsigned* as = mri_->getAliasSet(reg); *as; ++as)
|
|
|
|
handlePhysicalRegisterDef(mbb, mi, *as);
|
2003-11-20 03:32:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
handleVirtualRegisterDef(mbb, mi, reg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned LiveIntervals::getInstructionIndex(MachineInstr* instr) const
|
|
|
|
{
|
|
|
|
assert(mi2iMap_.find(instr) != mi2iMap_.end() &&
|
|
|
|
"instruction not assigned a number");
|
|
|
|
return mi2iMap_.find(instr)->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// computeIntervals - computes the live intervals for virtual
|
|
|
|
/// registers. for some ordering of the machine instructions [1,N] a
|
|
|
|
/// live interval is an interval [i, j] where 1 <= i <= j <= N for
|
|
|
|
/// which a variable is live
|
|
|
|
void LiveIntervals::computeIntervals()
|
|
|
|
{
|
|
|
|
DEBUG(std::cerr << "computing live intervals:\n");
|
|
|
|
|
|
|
|
for (MbbIndex2MbbMap::iterator
|
|
|
|
it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
|
|
|
|
it != itEnd; ++it) {
|
|
|
|
MachineBasicBlock* mbb = it->second;
|
|
|
|
DEBUG(std::cerr << "machine basic block: "
|
|
|
|
<< mbb->getBasicBlock()->getName() << "\n");
|
2003-12-21 20:19:10 +00:00
|
|
|
|
2003-11-20 03:32:25 +00:00
|
|
|
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
|
|
|
|
mi != miEnd; ++mi) {
|
|
|
|
MachineInstr* instr = *mi;
|
|
|
|
const TargetInstrDescriptor& tid =
|
|
|
|
tm_->getInstrInfo().get(instr->getOpcode());
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << "\t[" << getInstructionIndex(instr) << "] ";
|
2003-11-20 03:32:25 +00:00
|
|
|
instr->print(std::cerr, *tm_););
|
|
|
|
|
|
|
|
// handle implicit defs
|
2004-01-13 06:24:30 +00:00
|
|
|
for (const unsigned* id = tid.ImplicitDefs; *id; ++id)
|
|
|
|
handleRegisterDef(mbb, mi, *id);
|
2003-11-20 03:32:25 +00:00
|
|
|
|
|
|
|
// handle explicit defs
|
|
|
|
for (int i = instr->getNumOperands() - 1; i >= 0; --i) {
|
|
|
|
MachineOperand& mop = instr->getOperand(i);
|
|
|
|
|
2003-12-13 05:26:39 +00:00
|
|
|
if (!mop.isRegister())
|
2003-11-20 03:32:25 +00:00
|
|
|
continue;
|
|
|
|
|
2003-12-21 05:43:40 +00:00
|
|
|
// handle defs - build intervals
|
2004-01-13 06:24:30 +00:00
|
|
|
if (mop.isDef())
|
|
|
|
handleRegisterDef(mbb, mi, mop.getAllocatedRegNum());
|
2003-11-20 03:32:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-05 10:32:01 +00:00
|
|
|
std::sort(intervals_.begin(), intervals_.end(), StartPointComp());
|
2003-11-20 03:32:25 +00:00
|
|
|
DEBUG(std::copy(intervals_.begin(), intervals_.end(),
|
|
|
|
std::ostream_iterator<Interval>(std::cerr, "\n")));
|
|
|
|
}
|
2003-12-05 10:38:28 +00:00
|
|
|
|
2003-12-21 05:43:40 +00:00
|
|
|
LiveIntervals::Interval::Interval(unsigned r)
|
2003-12-28 17:58:18 +00:00
|
|
|
: reg(r), hint(0),
|
2003-12-21 05:43:40 +00:00
|
|
|
weight((r < MRegisterInfo::FirstVirtualRegister ?
|
2003-12-21 20:19:10 +00:00
|
|
|
std::numeric_limits<float>::max() : 0.0F))
|
2003-12-21 05:43:40 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-12-18 08:48:48 +00:00
|
|
|
void LiveIntervals::Interval::addRange(unsigned start, unsigned end)
|
|
|
|
{
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << "\t\t\tadding range: [" << start <<','<< end << ") -> ");
|
2003-12-18 08:48:48 +00:00
|
|
|
//assert(start < end && "invalid range?");
|
|
|
|
Range range = std::make_pair(start, end);
|
|
|
|
Ranges::iterator it =
|
|
|
|
ranges.insert(std::upper_bound(ranges.begin(), ranges.end(), range),
|
|
|
|
range);
|
|
|
|
|
|
|
|
mergeRangesForward(it);
|
|
|
|
mergeRangesBackward(it);
|
2004-01-13 21:53:20 +00:00
|
|
|
DEBUG(std::cerr << *this << '\n');
|
2003-12-18 08:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::Interval::mergeRangesForward(Ranges::iterator it)
|
|
|
|
{
|
|
|
|
for (Ranges::iterator next = it + 1;
|
|
|
|
next != ranges.end() && it->second >= next->first; ) {
|
|
|
|
it->second = std::max(it->second, next->second);
|
|
|
|
next = ranges.erase(next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LiveIntervals::Interval::mergeRangesBackward(Ranges::iterator it)
|
|
|
|
{
|
|
|
|
for (Ranges::iterator prev = it - 1;
|
|
|
|
it != ranges.begin() && it->first <= prev->second; ) {
|
|
|
|
it->first = std::min(it->first, prev->first);
|
|
|
|
it->second = std::max(it->second, prev->second);
|
|
|
|
it = ranges.erase(prev);
|
|
|
|
prev = it - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-21 05:43:40 +00:00
|
|
|
bool LiveIntervals::Interval::liveAt(unsigned index) const
|
|
|
|
{
|
|
|
|
Ranges::const_iterator r = ranges.begin();
|
|
|
|
while (r != ranges.end() && index < r->second) {
|
|
|
|
if (index >= r->first)
|
|
|
|
return true;
|
|
|
|
++r;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool LiveIntervals::Interval::overlaps(const Interval& other) const
|
|
|
|
{
|
2004-01-07 01:45:58 +00:00
|
|
|
Ranges::const_iterator i = ranges.begin();
|
|
|
|
Ranges::const_iterator j = other.ranges.begin();
|
|
|
|
|
|
|
|
while (i != ranges.end() && j != other.ranges.end()) {
|
|
|
|
if (i->first < j->first) {
|
|
|
|
if (i->second > j->first) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (j->first < i->first) {
|
|
|
|
if (j->second > i->first) {
|
2003-12-21 05:43:40 +00:00
|
|
|
return true;
|
2004-01-07 01:45:58 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return true;
|
|
|
|
}
|
2003-12-21 05:43:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2003-12-05 10:38:28 +00:00
|
|
|
std::ostream& llvm::operator<<(std::ostream& os,
|
|
|
|
const LiveIntervals::Interval& li)
|
|
|
|
{
|
2003-12-21 05:43:40 +00:00
|
|
|
os << "%reg" << li.reg << ',' << li.weight << " = ";
|
2003-12-05 10:38:28 +00:00
|
|
|
for (LiveIntervals::Interval::Ranges::const_iterator
|
|
|
|
i = li.ranges.begin(), e = li.ranges.end(); i != e; ++i) {
|
2004-01-13 21:17:47 +00:00
|
|
|
os << "[" << i->first << "," << i->second << ")";
|
2003-12-05 10:38:28 +00:00
|
|
|
}
|
|
|
|
return os;
|
|
|
|
}
|