Skip to content

Commit

Permalink
[MachineVerifier] Add check that renamable operands aren't reserved r…
Browse files Browse the repository at this point in the history
…egisters.

Summary:

Reviewers: qcolombet, MatzeB

Subscribers: arsenm, sdardis, nhaehnle, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D42449

llvm-svn: 323676
  • Loading branch information
geoffberry committed Jan 29, 2018
1 parent d37dc77 commit d1be911
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions llvm/lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,12 +1101,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
}
}
}
if (MO->isRenamable() &&
((MO->isDef() && MI->hasExtraDefRegAllocReq()) ||
(MO->isUse() && MI->hasExtraSrcRegAllocReq()))) {
report("Illegal isRenamable setting for opcode with extra regalloc "
"requirements",
MO, MONum);
if (MO->isRenamable()) {
if ((MO->isDef() && MI->hasExtraDefRegAllocReq()) ||
(MO->isUse() && MI->hasExtraSrcRegAllocReq()))
report("Illegal isRenamable setting for opcode with extra regalloc "
"requirements",
MO, MONum);
if (MRI->isReserved(Reg))
report("isRenamable set on reserved register", MO, MONum);
return;
}
} else {
Expand Down

0 comments on commit d1be911

Please sign in to comment.