Don't give implicit machine operands special treatment in the register scavenger.

Imp-def is *not* allowed to redefine a live register.
Imp-use is *not* allowed to use a dead register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2009-08-04 21:29:11 +00:00
parent 4dcff6db72
commit f955cbf56f

View File

@ -226,7 +226,7 @@ void RegScavenger::forward() {
const MachineOperand MO = *UseMOs[i].first;
unsigned Reg = MO.getReg();
assert((MO.isImplicit() || isUsed(Reg)) && "Using an undefined register!");
assert(isUsed(Reg) && "Using an undefined register!");
if (MO.isKill() && !isReserved(Reg)) {
KillRegs.set(Reg);
@ -276,10 +276,7 @@ void RegScavenger::forward() {
if (RedefinesSuperRegPart(MI, MO, TRI))
continue;
// Implicit def is allowed to "re-define" any register. Similarly,
// implicitly defined registers can be clobbered.
assert((MO.isImplicit() || isReserved(Reg) || isUnused(Reg) ||
isSuperRegUsed(Reg) ||
assert((isReserved(Reg) || isUnused(Reg) || isSuperRegUsed(Reg) ||
isLiveInButUnusedBefore(Reg, MI, MBB, TRI, MRI)) &&
"Re-defining a live register!");
setUsed(Reg);