memory operands that have a direct operand should have their stores created
[oota-llvm.git] / lib / CodeGen / LiveInterval.cpp
index 78c874cbb93b704a4bb48990589feffa82e20f27..45c1dd03da5881e46a9ba7a876e20ebf057c1c13 100644 (file)
@@ -349,6 +349,8 @@ void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments,
   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 @@ void LiveInterval::MergeValueNumberInto(unsigned V1, unsigned V2) {
   }
 }
 
+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 << ")";
 }
@@ -475,7 +484,7 @@ void LiveRange::dump() const {
   cerr << *this << "\n";
 }
 
-void LiveInterval::print(OStream OS, const MRegisterInfo *MRI) const {
+void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const {
   if (MRI && MRegisterInfo::isPhysicalRegister(reg))
     OS << MRI->getName(reg);
   else
@@ -512,7 +521,6 @@ void LiveInterval::dump() const {
 }
 
 
-OStream& llvm::operator<<(OStream& os, const LiveRange &LR) {
-  if (os.stream()) *os.stream() << LR;
-  return os;
+void LiveRange::print(std::ostream &os) const {
+  os << *this;
 }