llvm.org GIT mirror llvm / ebd7e6c
Instead of searching for a live interval pair, search for a location. This gives a very modest speedup of .3 seconds compiling 176.gcc (out of 20s). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15136 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
3 changed file(s) with 14 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
4545 LiveRange(); // DO NOT IMPLEMENT
4646 };
4747 std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
48
49 inline bool operator<(unsigned V, const LiveRange &LR) {
50 return V < LR.start;
51 }
52
4853
4954 /// LiveInterval - This class represents some number of live ranges for a
5055 /// register or value. This class also contains a bit of register allocator
2929 // definition of the variable it represents. This is because slot 1 is
3030 // used (def slot) and spans up to slot 3 (store slot).
3131 //
32 bool LiveInterval::liveAt(unsigned index) const {
33 LiveRange dummy(index, index+1);
34 Ranges::const_iterator r = std::upper_bound(ranges.begin(),
35 ranges.end(),
36 dummy);
32 bool LiveInterval::liveAt(unsigned I) const {
33 Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
34
3735 if (r == ranges.begin())
3836 return false;
3937
4038 --r;
41 return index >= r->start && index < r->end;
39 return I >= r->start && I < r->end;
4240 }
4341
4442 // An example for overlaps():
4545 LiveRange(); // DO NOT IMPLEMENT
4646 };
4747 std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
48
49 inline bool operator<(unsigned V, const LiveRange &LR) {
50 return V < LR.start;
51 }
52
4853
4954 /// LiveInterval - This class represents some number of live ranges for a
5055 /// register or value. This class also contains a bit of register allocator