[llvm-commits] [llvm] r43069 - in /llvm/trunk: include/llvm/CodeGen/LiveIntervalAnalysis.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegAllocLinearScan.cpp

Evan Cheng evan.cheng at apple.com
Tue Oct 16 23:53:44 PDT 2007


Author: evancheng
Date: Wed Oct 17 01:53:44 2007
New Revision: 43069

URL: http://llvm.org/viewvc/llvm-project?rev=43069&view=rev
Log:
Apply Chris' suggestions.

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
    llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=43069&r1=43068&r2=43069&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed Oct 17 01:53:44 2007
@@ -167,7 +167,7 @@
     /// is live in any MBB returns true as well as the list of basic blocks
     /// where the value is live in.
     bool findLiveInMBBs(const LiveRange &LR,
-                        SmallVector<MachineBasicBlock*, 4> &MBBs) const;
+                        SmallVectorImpl<MachineBasicBlock*> &MBBs) const;
 
     // Interval creation
 

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=43069&r1=43068&r2=43069&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Oct 17 01:53:44 2007
@@ -817,7 +817,7 @@
 }
 
 bool LiveIntervals::findLiveInMBBs(const LiveRange &LR,
-                               SmallVector<MachineBasicBlock*, 4> &MBBs) const {
+                              SmallVectorImpl<MachineBasicBlock*> &MBBs) const {
   std::vector<IdxMBBPair>::const_iterator I =
     std::lower_bound(Idx2MBBMap.begin(), Idx2MBBMap.end(), LR.start);
 

Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=43069&r1=43068&r2=43069&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Wed Oct 17 01:53:44 2007
@@ -290,6 +290,7 @@
 
   // Add live-ins to every BB except for entry.
   MachineFunction::iterator EntryMBB = mf_->begin();
+  SmallVector<MachineBasicBlock*, 8> LiveInMBBs;
   for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) {
     const LiveInterval &cur = i->second;
     unsigned Reg = 0;
@@ -302,11 +303,11 @@
     for (LiveInterval::Ranges::const_iterator I = cur.begin(), E = cur.end();
          I != E; ++I) {
       const LiveRange &LR = *I;
-      SmallVector<MachineBasicBlock*, 4> LiveInMBBs;
       if (li_->findLiveInMBBs(LR, LiveInMBBs)) {
         for (unsigned i = 0, e = LiveInMBBs.size(); i != e; ++i)
           if (LiveInMBBs[i] != EntryMBB)
             LiveInMBBs[i]->addLiveIn(Reg);
+        LiveInMBBs.clear();
       }
     }
   }





More information about the llvm-commits mailing list