diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -1237,6 +1237,10 @@ return false; } } + if (!RISCVII::hasSEWOp(TSFlags)) { + ErrInfo = "VL operand w/o SEW operand?"; + return false; + } } if (RISCVII::hasSEWOp(TSFlags)) { unsigned OpIdx = RISCVII::getSEWOpNum(Desc); @@ -1258,6 +1262,10 @@ ErrInfo = "Invalid Policy Value"; return false; } + if (!RISCVII::hasVLOp(TSFlags)) { + ErrInfo = "policy operand w/o VL operand?"; + return false; + } } return true;