diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-04-18 02:30:19 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-04-18 02:30:19 +0000 |
commit | faf05bbaea5893488dac4eee58700912ddfe28cc (patch) | |
tree | 5c8a3a72a1a920b4428204244126b22efbfd8b0f | |
parent | 5a713cc72fd56c81e4cccc582f5eb0c731ad7c9f (diff) | |
download | llvm-faf05bbaea5893488dac4eee58700912ddfe28cc.tar.gz llvm-faf05bbaea5893488dac4eee58700912ddfe28cc.tar.bz2 llvm-faf05bbaea5893488dac4eee58700912ddfe28cc.tar.xz |
Don't populate TryAgainList when coalescing only physical registers with virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36240 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 2 | ||||
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index a793e151d3..29d053910a 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -205,7 +205,7 @@ namespace llvm { /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting /// copies that cannot yet be coallesced into the "TryAgain" list. void CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector<CopyRec> &TryAgain, bool PhysOnly = false); + std::vector<CopyRec> *TryAgain, bool PhysOnly = false); /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index af2e19922d..8b181150f6 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1473,7 +1473,7 @@ namespace { void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, - std::vector<CopyRec> &TryAgain, bool PhysOnly) { + std::vector<CopyRec> *TryAgain, bool PhysOnly) { DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end(); @@ -1484,8 +1484,8 @@ void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue; - if (!JoinCopy(Inst, SrcReg, DstReg, PhysOnly)) - TryAgain.push_back(getCopyRec(Inst, SrcReg, DstReg)); + if (TryAgain && !JoinCopy(Inst, SrcReg, DstReg, PhysOnly)) + TryAgain->push_back(getCopyRec(Inst, SrcReg, DstReg)); } } @@ -1502,7 +1502,7 @@ void LiveIntervals::joinIntervals() { // If there are no loops in the function, join intervals in function order. for (MachineFunction::iterator I = mf_->begin(), E = mf_->end(); I != E; ++I) - CopyCoallesceInMBB(I, TryAgainList); + CopyCoallesceInMBB(I, &TryAgainList); } else { // Otherwise, join intervals in inner loops before other intervals. // Unfortunately we can't just iterate over loop hierarchy here because @@ -1519,9 +1519,9 @@ void LiveIntervals::joinIntervals() { // Finally, join intervals in loop nest order. for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, TryAgainList, true); + CopyCoallesceInMBB(MBBs[i].second, NULL, true); for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - CopyCoallesceInMBB(MBBs[i].second, TryAgainList, false); + CopyCoallesceInMBB(MBBs[i].second, &TryAgainList, false); } // Joining intervals can allow other intervals to be joined. Iteratively join |