mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
MachineVerifier: Allow physreg use if just a subreg is defined.
We can't mark partially undefined registers, so we have to allow reading a register in the machine verifier if just parts of a register are defined. llvm-svn: 223896
This commit is contained in:
parent
468dc2a2ae
commit
a4879cff1f
@ -1066,7 +1066,18 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) {
|
||||
if (!regsLive.count(Reg)) {
|
||||
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
|
||||
// Reserved registers may be used even when 'dead'.
|
||||
if (!isReserved(Reg))
|
||||
bool Bad = !isReserved(Reg);
|
||||
// We are fine if just any subregister has a defined value.
|
||||
if (Bad) {
|
||||
for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid();
|
||||
++SubRegs) {
|
||||
if (regsLive.count(*SubRegs)) {
|
||||
Bad = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Bad)
|
||||
report("Using an undefined physical register", MO, MONum);
|
||||
} else if (MRI->def_empty(Reg)) {
|
||||
report("Reading virtual register without a def", MO, MONum);
|
||||
|
Loading…
x
Reference in New Issue
Block a user