mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
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
This commit is contained in:
@@ -47,6 +47,11 @@ namespace llvm {
|
|||||||
};
|
};
|
||||||
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
|
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
|
||||||
|
|
||||||
|
inline bool operator<(unsigned V, const LiveRange &LR) {
|
||||||
|
return V < LR.start;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// LiveInterval - This class represents some number of live ranges for a
|
/// LiveInterval - This class represents some number of live ranges for a
|
||||||
/// register or value. This class also contains a bit of register allocator
|
/// register or value. This class also contains a bit of register allocator
|
||||||
/// state.
|
/// state.
|
||||||
|
@@ -30,16 +30,14 @@ using namespace llvm;
|
|||||||
// definition of the variable it represents. This is because slot 1 is
|
// definition of the variable it represents. This is because slot 1 is
|
||||||
// used (def slot) and spans up to slot 3 (store slot).
|
// used (def slot) and spans up to slot 3 (store slot).
|
||||||
//
|
//
|
||||||
bool LiveInterval::liveAt(unsigned index) const {
|
bool LiveInterval::liveAt(unsigned I) const {
|
||||||
LiveRange dummy(index, index+1);
|
Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
|
||||||
Ranges::const_iterator r = std::upper_bound(ranges.begin(),
|
|
||||||
ranges.end(),
|
|
||||||
dummy);
|
|
||||||
if (r == ranges.begin())
|
if (r == ranges.begin())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
--r;
|
--r;
|
||||||
return index >= r->start && index < r->end;
|
return I >= r->start && I < r->end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// An example for overlaps():
|
// An example for overlaps():
|
||||||
|
@@ -47,6 +47,11 @@ namespace llvm {
|
|||||||
};
|
};
|
||||||
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
|
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
|
||||||
|
|
||||||
|
inline bool operator<(unsigned V, const LiveRange &LR) {
|
||||||
|
return V < LR.start;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// LiveInterval - This class represents some number of live ranges for a
|
/// LiveInterval - This class represents some number of live ranges for a
|
||||||
/// register or value. This class also contains a bit of register allocator
|
/// register or value. This class also contains a bit of register allocator
|
||||||
/// state.
|
/// state.
|
||||||
|
Reference in New Issue
Block a user