Index: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp =================================================================== --- llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -1736,7 +1736,7 @@ // The VTypeIElements layout is: // SEW comma LMUL comma TA comma MA // 0 1 2 3 4 5 6 - StringRef Name = VTypeIElements[0].getIdentifier(); + StringRef Name = VTypeIElements[0].getString(); if (!Name.consume_front("e")) goto MatchFail; unsigned Sew; @@ -1745,7 +1745,7 @@ if (!RISCVVType::isValidSEW(Sew)) goto MatchFail; - Name = VTypeIElements[2].getIdentifier(); + Name = VTypeIElements[2].getString(); if (!Name.consume_front("m")) goto MatchFail; // "m" or "mf" @@ -1757,7 +1757,7 @@ goto MatchFail; // ta or tu - Name = VTypeIElements[4].getIdentifier(); + Name = VTypeIElements[4].getString(); bool TailAgnostic; if (Name == "ta") TailAgnostic = true; @@ -1767,7 +1767,7 @@ goto MatchFail; // ma or mu - Name = VTypeIElements[6].getIdentifier(); + Name = VTypeIElements[6].getString(); bool MaskAgnostic; if (Name == "ma") MaskAgnostic = true; Index: llvm/test/MC/RISCV/rvv/invalid.s =================================================================== --- llvm/test/MC/RISCV/rvv/invalid.s +++ llvm/test/MC/RISCV/rvv/invalid.s @@ -77,6 +77,24 @@ vsetvli a2, a0, e8,m1,ta # CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] +vsetvli zero, zero, 1, m1, ta, mu +# CHECK-ERROR: error: invalid operand for instruction + +vsetvli zero, zero, e32, 2, ta, mu +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli zero, zero, e32, m1, 3, mu +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli zero, zero, e32, m1, ta, 4 +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli zero, zero, "e32", m1, ta, mu +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli zero, zero, e32, "m1", ta, mu +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + vadd.vv v1, v3, v2, v4.t # CHECK-ERROR: operand must be v0.t