diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-10-17 06:53:44 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-10-17 06:53:44 +0000 |
commit | 0dde6e576123730af2465a37048060e02a741c72 (patch) | |
tree | b9e0ba2b8cad2c978382ce3e912d0a1fd1f006ae /llvm | |
parent | 12d5da49d3207ccbd746fa018bb086e60a5e410e (diff) | |
download | bcm5719-llvm-0dde6e576123730af2465a37048060e02a741c72.tar.gz bcm5719-llvm-0dde6e576123730af2465a37048060e02a741c72.zip |
Apply Chris' suggestions.
llvm-svn: 43069
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegAllocLinearScan.cpp | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h index c9f9d2dcc28..6f41ab664c3 100644 --- a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -167,7 +167,7 @@ namespace llvm { /// 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 diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 3aec772f1a9..ca6c04d8f75 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -817,7 +817,7 @@ void LiveIntervals::computeIntervals() { } 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); diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index e74f3333d24..8a9eb3de0b5 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -290,6 +290,7 @@ void RALinScan::linearScan() // 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 @@ void RALinScan::linearScan() 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(); } } } |