aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-08-31 08:26:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-08-31 08:26:44 +0000
commitd4e4937b79a7da789379a09117cc74f20cd60623 (patch)
tree57f6f9f514cad5a4734fe5e15cf9bb3663a93787
parentc14b144ec30424bda7386dec83848188227660ed (diff)
downloadexternal_llvm-d4e4937b79a7da789379a09117cc74f20cd60623.tar.gz
external_llvm-d4e4937b79a7da789379a09117cc74f20cd60623.tar.bz2
external_llvm-d4e4937b79a7da789379a09117cc74f20cd60623.zip
Remove an unnecessary element, saving 4 bytes per LiveInterval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41641 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/LiveInterval.h9
-rw-r--r--lib/CodeGen/LiveInterval.cpp3
2 files changed, 4 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index f73cac1892..a80df8f8b8 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -106,12 +106,11 @@ namespace llvm {
unsigned preference; // preferred register to allocate for this interval
float weight; // weight of this interval
Ranges ranges; // the ranges in which this register is live
- unsigned numvals; // number of value#'s
VNInfoList valnos; // value#'s
public:
LiveInterval(unsigned Reg, float Weight)
- : reg(Reg), preference(0), weight(Weight), numvals(0) {
+ : reg(Reg), preference(0), weight(Weight) {
}
typedef Ranges::iterator iterator;
@@ -151,9 +150,9 @@ namespace llvm {
return I;
}
- bool containsOneValue() const { return numvals == 1; }
+ bool containsOneValue() const { return valnos.size() == 1; }
- unsigned getNumValNums() const { return numvals; }
+ unsigned getNumValNums() const { return valnos.size(); }
/// getFirstValNumInfo - Returns pointer to the first val#.
///
@@ -175,7 +174,7 @@ namespace llvm {
/// getNextValue - Create a new value number and return it. MIIdx specifies
/// the instruction that defines the value number.
VNInfo *getNextValue(unsigned MIIdx, unsigned SrcReg) {
- VNInfo *VNI = new VNInfo(this, numvals++, MIIdx, SrcReg);
+ VNInfo *VNI = new VNInfo(this, valnos.size(), MIIdx, SrcReg);
valnos.push_back(VNI);
return VNI;
}
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index b10a721820..c9e98bc42a 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -349,13 +349,11 @@ void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments,
// Update val# info. Renumber them and make sure they all belong to this
// LiveInterval now.
valnos.clear();
- numvals = 0;
for (unsigned i = 0, e = NewVNInfo.size(); i != e; ++i) {
VNInfo *VNI = NewVNInfo[i];
VNI->parent = this;
VNI->id = i; // Renumber val#.
valnos.push_back(VNI);
- ++numvals;
}
// Okay, now insert the RHS live ranges into the LHS.
@@ -484,7 +482,6 @@ void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) {
VNInfo *VNI = valnos.back();
valnos.pop_back();
delete VNI;
- --numvals;
} while (valnos.back()->def == ~1U);
} else {
V1->def = ~1U;