mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	Also verify RegUnit intervals at uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -804,23 +804,44 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     // Check LiveInts liveness and kill. |     // Check LiveInts liveness and kill. | ||||||
|     if (TargetRegisterInfo::isVirtualRegister(Reg) && |     if (LiveInts && !LiveInts->isNotInMIMap(MI)) { | ||||||
|         LiveInts && !LiveInts->isNotInMIMap(MI)) { |       SlotIndex UseIdx = LiveInts->getInstructionIndex(MI); | ||||||
|       SlotIndex UseIdx = LiveInts->getInstructionIndex(MI).getRegSlot(true); |       // Check the cached regunit intervals. | ||||||
|       if (LiveInts->hasInterval(Reg)) { |       if (TargetRegisterInfo::isPhysicalRegister(Reg) && !isReserved(Reg)) { | ||||||
|         const LiveInterval &LI = LiveInts->getInterval(Reg); |         for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) { | ||||||
|         if (!LI.liveAt(UseIdx)) { |           if (const LiveInterval *LI = LiveInts->getCachedRegUnit(*Units)) { | ||||||
|           report("No live range at use", MO, MONum); |             LiveRangeQuery LRQ(*LI, UseIdx); | ||||||
|           *OS << UseIdx << " is not live in " << LI << '\n'; |             if (!LRQ.valueIn()) { | ||||||
|  |               report("No live range at use", MO, MONum); | ||||||
|  |               *OS << UseIdx << " is not live in " << PrintRegUnit(*Units, TRI) | ||||||
|  |                   << ' ' << *LI << '\n'; | ||||||
|  |             } | ||||||
|  |             if (MO->isKill() && !LRQ.isKill()) { | ||||||
|  |               report("Live range continues after kill flag", MO, MONum); | ||||||
|  |               *OS << PrintRegUnit(*Units, TRI) << ' ' << *LI << '\n'; | ||||||
|  |             } | ||||||
|  |           } | ||||||
|         } |         } | ||||||
|         // Check for extra kill flags. |       } | ||||||
|         // Note that we allow missing kill flags for now. |  | ||||||
|         if (MO->isKill() && !LI.killedAt(UseIdx.getRegSlot())) { |       if (TargetRegisterInfo::isVirtualRegister(Reg)) { | ||||||
|           report("Live range continues after kill flag", MO, MONum); |         if (LiveInts->hasInterval(Reg)) { | ||||||
|           *OS << "Live range: " << LI << '\n'; |           // This is a virtual register interval. | ||||||
|  |           const LiveInterval &LI = LiveInts->getInterval(Reg); | ||||||
|  |           LiveRangeQuery LRQ(LI, UseIdx); | ||||||
|  |           if (!LRQ.valueIn()) { | ||||||
|  |             report("No live range at use", MO, MONum); | ||||||
|  |             *OS << UseIdx << " is not live in " << LI << '\n'; | ||||||
|  |           } | ||||||
|  |           // Check for extra kill flags. | ||||||
|  |           // Note that we allow missing kill flags for now. | ||||||
|  |           if (MO->isKill() && !LRQ.isKill()) { | ||||||
|  |             report("Live range continues after kill flag", MO, MONum); | ||||||
|  |             *OS << "Live range: " << LI << '\n'; | ||||||
|  |           } | ||||||
|  |         } else { | ||||||
|  |           report("Virtual register has no live interval", MO, MONum); | ||||||
|         } |         } | ||||||
|       } else { |  | ||||||
|         report("Virtual register has no Live interval", MO, MONum); |  | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user