[PATCH] D124161: [RISCV][AsmParser] Fix parsing of the components of the vtype immediate of vsetvli

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 02:15:09 PDT 2022


rogfer01 added inline comments.


================
Comment at: llvm/test/MC/RISCV/rvv/invalid.s:81
+vsetvli zero, zero, 1, m1, ta, mu
+# CHECK-ERROR: error: invalid operand for instruction
+
----------------
StephenFan wrote:
> This error message seems a little bad. Would you mind improving the error message? Since improving this error message may cause other cases' error messages badly, doing this may require trade-offs in many cases. 
> IMO, we can report specific errors and return `MatchOperand_ParseFail` when the operand must be a VTypeI operand  (Maybe if the operand can get 7 tokens or other judge condition, then it must a vtypeI) and we get into trouble in parsing VTypeI's elements.
Sure. I also noticed the diagnostic always points at the beginning of the whole operand.

I will check that the operand parser routine is not speculatively executed and see if we can be more precise in the diagnostic.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124161/new/

https://reviews.llvm.org/D124161



More information about the llvm-commits mailing list