mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
[MachineVerifier] Check that even generic vregs comply to regclass constraints.
We used to not check generic vregs, but that is actually a mistake given nothing in the GlobalISel pipeline is going to fix the constraints on target specific instructions. Therefore, the target has to have them right from the start. llvm-svn: 290380
This commit is contained in:
parent
3a3a5a1c0d
commit
6877ce89ac
@ -1056,6 +1056,21 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
|
||||
MONum);
|
||||
return;
|
||||
}
|
||||
|
||||
// If this is a target specific instruction and this operand
|
||||
// has register class constraint, the virtual register must
|
||||
// comply to it.
|
||||
if (!isPreISelGenericOpcode(MCID.getOpcode()) &&
|
||||
TII->getRegClass(MCID, MONum, TRI, *MF)) {
|
||||
report("Virtual register does not match instruction constraint", MO,
|
||||
MONum);
|
||||
errs() << "Expect register class "
|
||||
<< TRI->getRegClassName(
|
||||
TII->getRegClass(MCID, MONum, TRI, *MF))
|
||||
<< " but got nothing\n";
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if (SubIdx) {
|
||||
|
Loading…
Reference in New Issue
Block a user