Skip to content

Commit ac9d944

Browse files
committed
[RISC-V] Add a call to RISCV_MC::verifyInstructionPredicates in AsmParser
This ensures the broken Asmparser expansions trigger an assertion error. Noticed this while adding Y extension support where expanding pseudos generated instructions that were failing predicates but unlike instructions generated during codegen the predicate verification function was not being called here.
1 parent c5884c5 commit ac9d944

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,6 +3545,8 @@ void RISCVAsmParser::emitToStreamer(MCStreamer &S, const MCInst &Inst) {
35453545
Res = RISCVRVC::compress(CInst, Inst, STI);
35463546
if (Res)
35473547
++RISCVNumInstrsCompressed;
3548+
// Ensure that we don't emit instructions with missing predicates.
3549+
RISCV_MC::verifyInstructionPredicates(Inst.getOpcode(), STI.getFeatureBits());
35483550
S.emitInstruction((Res ? CInst : Inst), STI);
35493551
}
35503552

0 commit comments

Comments
 (0)