mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Fix more places assuming subregisters have live intervals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -211,6 +211,8 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP, | |||||||
|   // physreg has sub-registers, update their live intervals as well. |   // physreg has sub-registers, update their live intervals as well. | ||||||
|   if (TargetRegisterInfo::isPhysicalRegister(IntB.reg)) { |   if (TargetRegisterInfo::isPhysicalRegister(IntB.reg)) { | ||||||
|     for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { |     for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { | ||||||
|  |       if (!li_->hasInterval(*SR)) | ||||||
|  |         continue; | ||||||
|       LiveInterval &SRLI = li_->getInterval(*SR); |       LiveInterval &SRLI = li_->getInterval(*SR); | ||||||
|       SRLI.addRange(LiveRange(FillerStart, FillerEnd, |       SRLI.addRange(LiveRange(FillerStart, FillerEnd, | ||||||
|                               SRLI.getNextValue(FillerStart, 0, true, |                               SRLI.getNextValue(FillerStart, 0, true, | ||||||
| @@ -392,7 +394,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, | |||||||
|   // clobbers from the superreg. |   // clobbers from the superreg. | ||||||
|   if (BHasSubRegs) |   if (BHasSubRegs) | ||||||
|     for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) |     for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) | ||||||
|       if (HasOtherReachingDefs(IntA, li_->getInterval(*SR), AValNo, 0)) |       if (li_->hasInterval(*SR) && | ||||||
|  |           HasOtherReachingDefs(IntA, li_->getInterval(*SR), AValNo, 0)) | ||||||
|         return false; |         return false; | ||||||
|  |  | ||||||
|   // If some of the uses of IntA.reg is already coalesced away, return false. |   // If some of the uses of IntA.reg is already coalesced away, return false. | ||||||
| @@ -498,6 +501,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, | |||||||
|     VNInfo *DeadVNI = BDeadValNos[i]; |     VNInfo *DeadVNI = BDeadValNos[i]; | ||||||
|     if (BHasSubRegs) { |     if (BHasSubRegs) { | ||||||
|       for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { |       for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { | ||||||
|  |         if (!li_->hasInterval(*SR)) | ||||||
|  |           continue; | ||||||
|         LiveInterval &SRLI = li_->getInterval(*SR); |         LiveInterval &SRLI = li_->getInterval(*SR); | ||||||
|         if (const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def)) |         if (const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def)) | ||||||
|           SRLI.removeValNo(SRLR->valno); |           SRLI.removeValNo(SRLR->valno); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user