diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-03-11 22:18:44 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-03-11 22:18:44 +0000 |
| commit | 6cba5616487f65d6da7db636c82bdd972dd72395 (patch) | |
| tree | b76ddf27e8ea2c96b62c7b3d25edeb6e367b9e6b /llvm/lib/CodeGen | |
| parent | 8ce48d8c108ec4e578a9facf93d578aa99eef716 (diff) | |
| download | bcm5719-llvm-6cba5616487f65d6da7db636c82bdd972dd72395.tar.gz bcm5719-llvm-6cba5616487f65d6da7db636c82bdd972dd72395.zip | |
My last coalescer fix introduced a subtler one. It's aborting a commuting optimization too late and left the live intervals to be out of sync with instructions. This fixes 8b10b.
llvm-svn: 66715
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index c29ee62c83e..277b1e6d275 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -400,9 +400,6 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA, const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx); BHasPHIKill |= DLR->valno->hasPHIKill; assert(DLR->valno->def == DefIdx); - if (BHasSubRegs) - // Don't know how to update sub-register live intervals. - return false; BDeadValNos.push_back(DLR->valno); BExtend[DLR->start] = DLR->end; JoinedCopies.insert(UseMI); @@ -418,8 +415,17 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA, DOUT << "\nExtending: "; IntB.print(DOUT, tri_); // Remove val#'s defined by copies that will be coalesced away. - for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i) + for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i) { + VNInfo *DeadVNI = BDeadValNos[i]; + if (BHasSubRegs) { + for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { + LiveInterval &SRLI = li_->getInterval(*SR); + const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def); + SRLI.removeValNo(SRLR->valno); + } + } IntB.removeValNo(BDeadValNos[i]); + } // Extend BValNo by merging in IntA live ranges of AValNo. Val# definition // is updated. Kills are also updated. @@ -443,7 +449,7 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA, // If the IntB live range is assigned to a physical register, and if that // physreg has sub-registers, update their live intervals as well. - if (TargetRegisterInfo::isPhysicalRegister(IntB.reg)) { + if (BHasSubRegs) { for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { LiveInterval &SRLI = li_->getInterval(*SR); SRLI.MergeInClobberRange(AI->start, End, li_->getVNInfoAllocator()); |

