Handle <undef> flag in machine code verifier.

Use of an <undef> register is treated like an <imp-use>. It is not an error to use a dead <undef> register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2009-08-02 07:38:21 +00:00
parent 18a4c16726
commit bcdbcb9f95

View File

@ -365,7 +365,8 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum)
addRegWithSubRegs(regsKilled, Reg);
}
// Explicit use of a dead register.
if (!MO->isImplicit() && !regsLive.count(Reg)) {
// A register use marked <undef> is OK.
if (!MO->isImplicit() && !MO->isUndef() && !regsLive.count(Reg)) {
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
// Reserved registers may be used even when 'dead'.
if (!isReserved(Reg))