Subzero: Register allocator performance improvements and simplifications.
This removes the redundancy between live ranges stored in the Variable and those stored in Liveness, by removing the Liveness copy. After liveness analysis, live ranges are constructed directly into the Variable.
Also, the LiveRangeWrapper is removed and Variable * is directly used instead. The original thought behind LiveRangeWrapper was that it could be extended to include live range splitting. However, when/if live range splitting is implemented, it will probably involve creating a new variable with its own live range, and carrying around some extra bookkeeping until the split is committed, so such a wrapper probably won't be needed.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/656023002
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 9a31606..9d864fc 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -412,6 +412,7 @@
void setWeight(uint32_t NewWeight) { Weight = NewWeight; }
void setWeightInfinite() { Weight = RegWeight::Inf; }
+ LiveRange &getLiveRange() { return Live; }
const LiveRange &getLiveRange() const { return Live; }
void setLiveRange(const LiveRange &Range) { Live = Range; }
void resetLiveRange() { Live.reset(); }
@@ -426,6 +427,17 @@
void setLiveRangeInfiniteWeight() { Live.setWeight(RegWeight::Inf); }
void trimLiveRange(InstNumberT Start) { Live.trim(Start); }
void untrimLiveRange() { Live.untrim(); }
+ bool rangeEndsBefore(const Variable *Other) const {
+ return Live.endsBefore(Other->Live);
+ }
+ bool rangeOverlaps(const Variable *Other) const {
+ const bool UseTrimmed = true;
+ return Live.overlaps(Other->Live, UseTrimmed);
+ }
+ bool rangeOverlapsStart(const Variable *Other) const {
+ const bool UseTrimmed = true;
+ return Live.overlapsInst(Other->Live.getStart(), UseTrimmed);
+ }
Variable *getLo() const { return LoVar; }
Variable *getHi() const { return HiVar; }