mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
Teach the machine code verifier to use getSubRegisterRegClass().
The old approach was wrong. It had an off-by-one error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2ae4bfd769
commit
6a8d2c6119
@ -635,11 +635,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
|
||||
// Virtual register.
|
||||
const TargetRegisterClass *RC = MRI->getRegClass(Reg);
|
||||
if (SubIdx) {
|
||||
if (RC->subregclasses_begin()+SubIdx >= RC->subregclasses_end()) {
|
||||
const TargetRegisterClass *SRC = RC->getSubRegisterRegClass(SubIdx);
|
||||
if (!SRC) {
|
||||
report("Invalid subregister index for virtual register", MO, MONum);
|
||||
*OS << "Register class " << RC->getName()
|
||||
<< " does not support subreg index " << SubIdx << "\n";
|
||||
return;
|
||||
}
|
||||
RC = *(RC->subregclasses_begin()+SubIdx);
|
||||
RC = SRC;
|
||||
}
|
||||
if (const TargetRegisterClass *DRC = TOI.getRegClass(TRI)) {
|
||||
if (RC != DRC && !RC->hasSuperClass(DRC)) {
|
||||
|
Loading…
Reference in New Issue
Block a user