Index: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp =================================================================== --- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -1220,6 +1220,15 @@ } } + uint64_t TSFlags = MI.getDesc().TSFlags; + if (RISCVII::hasVLOp(TSFlags) && !RISCVII::hasSEWOp(TSFlags)) { + ErrInfo = "VL operand w/o SEW operand?"; + return false; + } + if (RISCVII::hasVecPolicyOp(TSFlags) && !RISCVII::hasVLOp(TSFlags)) { + ErrInfo = "policy operand w/o VL operand?"; + return false; + } return true; }