Remove defs vector from live intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13892 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos 2004-05-29 16:18:57 +00:00
parent aafb1c16b4
commit f717a05698
3 changed files with 0 additions and 22 deletions

View File

@ -36,12 +36,10 @@ namespace llvm {
struct Interval {
typedef std::pair<unsigned, unsigned> Range;
typedef std::vector<Range> Ranges;
typedef std::vector<unsigned> Defs;
unsigned reg; // the register of this interval
float weight; // weight of this interval (number of uses
// * 10^loopDepth)
Ranges ranges; // the ranges in which this register is live
Defs defs;
Interval(unsigned r);
bool empty() const { return ranges.empty(); }

View File

@ -137,11 +137,6 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
rep(srcReg) == rep(dstReg)) {
// remove from def list
Interval& interval = getOrCreateInterval(rep(dstReg));
unsigned defIndex = getInstructionIndex(mii);
Interval::Defs::iterator d = std::lower_bound(
interval.defs.begin(), interval.defs.end(), defIndex);
assert(*d == defIndex && "Def index not found in def list!");
interval.defs.erase(d);
// remove index -> MachineInstr and
// MachineInstr -> index mappings
Mi2IndexMap::iterator mi2i = mi2iMap_.find(mii);
@ -289,7 +284,6 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb,
}
unsigned baseIndex = getInstructionIndex(mi);
interval.defs.push_back(baseIndex);
bool killedInDefiningBasicBlock = false;
for (int i = 0, e = vi.Kills.size(); i != e; ++i) {
@ -329,7 +323,6 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
MachineBasicBlock::iterator e = mbb->end();
unsigned baseIndex = getInstructionIndex(mi);
interval.defs.push_back(baseIndex);
unsigned start = getDefIndex(baseIndex);
unsigned end = start;
@ -663,11 +656,6 @@ void LiveIntervals::Interval::join(const LiveIntervals::Interval& other)
cur = mergeRangesBackward(cur);
}
weight += other.weight;
Defs u;
std::set_union(defs.begin(), defs.end(),
other.defs.begin(), other.defs.end(),
std::back_inserter(u));
defs = u;
++numJoins;
}
@ -707,12 +695,6 @@ std::ostream& llvm::operator<<(std::ostream& os,
if (li.empty())
return os << "EMPTY";
os << " {" << li.defs.front();
for (LiveIntervals::Interval::Defs::const_iterator
i = next(li.defs.begin()), e = li.defs.end(); i != e; ++i)
os << "," << *i;
os << "}";
os << " = ";
for (LiveIntervals::Interval::Ranges::const_iterator
i = li.ranges.begin(), e = li.ranges.end(); i != e; ++i) {

View File

@ -36,12 +36,10 @@ namespace llvm {
struct Interval {
typedef std::pair<unsigned, unsigned> Range;
typedef std::vector<Range> Ranges;
typedef std::vector<unsigned> Defs;
unsigned reg; // the register of this interval
float weight; // weight of this interval (number of uses
// * 10^loopDepth)
Ranges ranges; // the ranges in which this register is live
Defs defs;
Interval(unsigned r);
bool empty() const { return ranges.empty(); }