Various bits of existing code assume the presence of one operand implies the presence of another. Add verifier rules to catch violations.
Differential Revision: https://reviews.llvm.org/D133810
return false;
}
}
+ if (!RISCVII::hasSEWOp(TSFlags)) {
+ ErrInfo = "VL operand w/o SEW operand?";
+ return false;
+ }
}
if (RISCVII::hasSEWOp(TSFlags)) {
unsigned OpIdx = RISCVII::getSEWOpNum(Desc);
ErrInfo = "Invalid Policy Value";
return false;
}
+ if (!RISCVII::hasVLOp(TSFlags)) {
+ ErrInfo = "policy operand w/o VL operand?";
+ return false;
+ }
}
return true;