[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp
Evan Cheng
evan.cheng at apple.com
Tue Apr 17 13:25:32 PDT 2007
Changes in directory llvm/lib/CodeGen:
LiveInterval.cpp updated: 1.43 -> 1.44
---
Log message:
Add a register allocation preference field; add a method to compute size of a live interval.
---
Diffs of the changes: (+9 -0)
LiveInterval.cpp | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/lib/CodeGen/LiveInterval.cpp
diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.43 llvm/lib/CodeGen/LiveInterval.cpp:1.44
--- llvm/lib/CodeGen/LiveInterval.cpp:1.43 Sat Dec 16 23:15:13 2006
+++ llvm/lib/CodeGen/LiveInterval.cpp Tue Apr 17 15:25:11 2007
@@ -349,6 +349,8 @@
ValueNumberInfo.clear();
ValueNumberInfo.append(NewValueNumberInfo.begin(), NewValueNumberInfo.end());
weight += Other.weight;
+ if (Other.preference && !preference)
+ preference = Other.preference;
}
/// MergeRangesInAsValue - Merge all of the intervals in RHS into this live
@@ -467,6 +469,13 @@
}
}
+unsigned LiveInterval::getSize() const {
+ unsigned Sum = 0;
+ for (const_iterator I = begin(), E = end(); I != E; ++I)
+ Sum += I->end - I->start;
+ return Sum;
+}
+
std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) {
return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")";
}
More information about the llvm-commits
mailing list