mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
More asserts around physreg uses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103685 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -487,7 +487,7 @@ unsigned RAFast::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// reservePhysReg - Mark PhysReg as reserved. This is very similar to
|
/// reservePhysReg - Mark PhysReg as reserved. This is very similar to
|
||||||
/// defineVirtReg except the physreg is reverved instead of allocated.
|
/// defineVirtReg except the physreg is reserved instead of allocated.
|
||||||
void RAFast::reservePhysReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
void RAFast::reservePhysReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
||||||
unsigned PhysReg) {
|
unsigned PhysReg) {
|
||||||
UsedInInstr.set(PhysReg);
|
UsedInInstr.set(PhysReg);
|
||||||
@ -623,6 +623,16 @@ void RAFast::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg) ||
|
if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg) ||
|
||||||
ReservedRegs.test(Reg)) continue;
|
ReservedRegs.test(Reg)) continue;
|
||||||
if (MO.isUse()) {
|
if (MO.isUse()) {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
// We are using a physreg directly. It had better not be clobbered by a
|
||||||
|
// virtreg.
|
||||||
|
assert(PhysRegState[Reg] <= regReserved && "Using clobbered physreg");
|
||||||
|
if (PhysRegState[Reg] == regDisabled)
|
||||||
|
for (const unsigned *AS = TRI->getAliasSet(Reg);
|
||||||
|
unsigned Alias = *AS; ++AS)
|
||||||
|
assert(PhysRegState[Alias] <= regReserved &&
|
||||||
|
"Physreg alias was clobbered");
|
||||||
|
#endif
|
||||||
PhysKills.push_back(Reg); // Any clean physreg use is a kill.
|
PhysKills.push_back(Reg); // Any clean physreg use is a kill.
|
||||||
UsedInInstr.set(Reg);
|
UsedInInstr.set(Reg);
|
||||||
} else if (MO.isEarlyClobber()) {
|
} else if (MO.isEarlyClobber()) {
|
||||||
|
Reference in New Issue
Block a user