llvm.org GIT mirror llvm / d4e4937
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 Evan Cheng 12 years ago
2 changed file(s) with 5 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
105105 unsigned preference; // preferred register to allocate for this interval
106106 float weight; // weight of this interval
107107 Ranges ranges; // the ranges in which this register is live
108 unsigned numvals; // number of value#'s
109108 VNInfoList valnos; // value#'s
110109
111110 public:
112111 LiveInterval(unsigned Reg, float Weight)
113 : reg(Reg), preference(0), weight(Weight), numvals(0) {
112 : reg(Reg), preference(0), weight(Weight) {
114113 }
115114
116115 typedef Ranges::iterator iterator;
150149 return I;
151150 }
152151
153 bool containsOneValue() const { return numvals == 1; }
154
155 unsigned getNumValNums() const { return numvals; }
152 bool containsOneValue() const { return valnos.size() == 1; }
153
154 unsigned getNumValNums() const { return valnos.size(); }
156155
157156 /// getFirstValNumInfo - Returns pointer to the first val#.
158157 ///
174173 /// getNextValue - Create a new value number and return it. MIIdx specifies
175174 /// the instruction that defines the value number.
176175 VNInfo *getNextValue(unsigned MIIdx, unsigned SrcReg) {
177 VNInfo *VNI = new VNInfo(this, numvals++, MIIdx, SrcReg);
176 VNInfo *VNI = new VNInfo(this, valnos.size(), MIIdx, SrcReg);
178177 valnos.push_back(VNI);
179178 return VNI;
180179 }
348348 // Update val# info. Renumber them and make sure they all belong to this
349349 // LiveInterval now.
350350 valnos.clear();
351 numvals = 0;
352351 for (unsigned i = 0, e = NewVNInfo.size(); i != e; ++i) {
353352 VNInfo *VNI = NewVNInfo[i];
354353 VNI->parent = this;
355354 VNI->id = i; // Renumber val#.
356355 valnos.push_back(VNI);
357 ++numvals;
358356 }
359357
360358 // Okay, now insert the RHS live ranges into the LHS.
483481 VNInfo *VNI = valnos.back();
484482 valnos.pop_back();
485483 delete VNI;
486 --numvals;
487484 } while (valnos.back()->def == ~1U);
488485 } else {
489486 V1->def = ~1U;