[RISCV] Verify that policy operands only exist on instructions with tied passthru operands
This is a non-trivial property relied upon by D135396. I wrote this to convince myself it was true. Differential Revision: https://reviews.llvm.org/D135403
This commit is contained in:
parent
76ac3b8917
commit
027516553d
|
@ -1266,6 +1266,15 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI,
|
|||
ErrInfo = "policy operand w/o VL operand?";
|
||||
return false;
|
||||
}
|
||||
|
||||
// VecPolicy operands can only exist on instructions with passthru/merge
|
||||
// arguments. Note that not all arguments with passthru have vec policy
|
||||
// operands- some instructions have implicit policies.
|
||||
unsigned UseOpIdx;
|
||||
if (!MI.isRegTiedToUseOperand(0, &UseOpIdx)) {
|
||||
ErrInfo = "policy operand w/o tied operand?";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue